commit 4a7e07a4b130150e6dc0f2152fa795e405679cc4
parent e251314099ecd2d68106cf67fa8ae5f2d8756607
Author: Tobias Kortkamp <git@tobik.me>
Date: Tue, 30 Aug 2016 17:17:40 +0200
Plug memory leak in handle_targets
From the OpenBSD ports tree:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/x11/xsel
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;
}
/*