[dev] [lsw] [patch] Memory leak from XGetTextProperty

From: Virgile Andreani <virgile.andreani_AT_anbuco.fr>
Date: Sat, 12 Apr 2014 17:15:24 +0200

Dear suckless developers,

The manpage of XGetTextProperty mentions:

> An extra byte containing null (which is not included in the nitems
> member) is stored at the end of the value field of text_prop_return.

Which, if I understand correctly, means that the value field of the
property is dynamically allocated at every successful run of this
function, and even if nitem equals zero, in which case a bare '\0' is
stored into the field. Hence this patch, which frees the value field
at two places where this was not handled.

Virgile Andreani

Received on Sat Apr 12 2014 - 17:15:24 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 12 2014 - 17:24:05 CEST