[dev] [dwm] drw_scm_free() and drw_clr_free() in drw.h

From: Listeria monocytogenes <listeria_AT_disroot.org>
Date: Fri, 26 Sep 2025 22:15:30 +0000

The Xft(3) man page says:

> XftColorAllocName() and XftColorAllocValue() request a color allocation
> from the X server (if necessary) and initialize the members of XftColor.
> XftColorFree() instructs the X server to free the color currently allo‐
> cated for an XftColor.

drw_scm_create() calls drw_clr_create() which in turn calls
XftColorAllocName(), but instructs the user to call free(3) on the
returned color scheme, which is insufficient, as the color allocated by
XftColorAllocName() was not free'd.

I suggest adding the functions drw_clr_free(Drw *drw, Clr *clr) and
drw_scm_free(Drw *drw, Clr *scm, size_t clrcount) to properly free the
allocated color and scheme.
Received on Sat Sep 27 2025 - 00:15:30 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 27 2025 - 00:24:09 CEST