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.

Reply via email to