mirror of
https://github.com/gryf/wmaker.git
synced 2026-10-09 19:22:30 +02:00
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 <christophe.curis@free.fr>
This commit is contained in:
1 parent
6831daf427
commit
482d8d3583
1 file changed
+1
@@ -2052,6 +2052,7 @@ static WMData *requestHandler(WMView * view, Atom selection, Atom target, void *
|
|||||||
if (text) {
|
if (text) {
|
||||||
data = WMCreateDataWithBytes(text, strlen(text));
|
data = WMCreateDataWithBytes(text, strlen(text));
|
||||||
WMSetDataFormat(data, TYPETEXT);
|
WMSetDataFormat(data, TYPETEXT);
|
||||||
|
wfree(text);
|
||||||
}
|
}
|
||||||
*type = target;
|
*type = target;
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in new issue
Block a user