commit ca00b8e283a8a327c17521d921fc41a449c39a42
parent e251314099ecd2d68106cf67fa8ae5f2d8756607
Author: Conrad Parker <conrad@metadecks.org>
Date: Fri, 2 Sep 2016 12:26:13 +1000
Merge pull request #18 from t6/master
Plug memory leak in handle_targets
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/xsel.c b/xsel.c
@@ -1395,14 +1395,16 @@ handle_targets (Display * display, Window requestor, Atom property,
Atom selection, Time time, MultTrack * mparent)
{
Atom * targets_cpy;
+ HandleResult r;
targets_cpy = malloc (sizeof (supported_targets));
memcpy (targets_cpy, supported_targets, sizeof (supported_targets));
- return
- change_property (display, requestor, property, XA_ATOM, 32,
+ r = change_property (display, requestor, property, XA_ATOM, 32,
PropModeReplace, (unsigned char *)targets_cpy,
NUM_TARGETS, selection, time, mparent);
+ free(targets_cpy);
+ return r;
}
/*