From 482d8d3583b4e8fecd85edcf0de49633e5a2d851 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 18 May 2014 21:31:46 +0200 Subject: [PATCH] WINGs: fix memory leak in requestHandler (Coverity #50135) As pointed by Coverity, the data returned by WMGetTextSelectedStream are actually a newly allocated buffer, so we need to release it when we're done with it. Signed-off-by: Christophe CURIS --- WINGs/wtext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/WINGs/wtext.c b/WINGs/wtext.c index 074da89c..495be70a 100644 --- a/WINGs/wtext.c +++ b/WINGs/wtext.c @@ -2052,6 +2052,7 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void * if (text) { data = WMCreateDataWithBytes(text, strlen(text)); WMSetDataFormat(data, TYPETEXT); + wfree(text); } *type = target; return data;