mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-21 14:34:19 +01: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:
committed by
Carlos R. Mafra
parent
6831daf427
commit
482d8d3583
@@ -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