1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-07 14:24:14 +01:00

WINGs: fix memory leak in getStreamObjects (Coverity #50119)

As pointed by Coverity, the array used to build the result for the
function 'getStreamObjects' could leak in case of early return.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-18 21:31:45 +02:00
committed by Carlos R. Mafra
parent 0134720621
commit 6831daf427

View File

@@ -2898,7 +2898,7 @@ static void releaseStreamObjects(void *data)
static WMArray *getStreamObjects(WMText * tPtr, int sel) static WMArray *getStreamObjects(WMText * tPtr, int sel)
{ {
WMArray *array = WMCreateArrayWithDestructor(4, releaseStreamObjects); WMArray *array;
WMData *data; WMData *data;
char *stream; char *stream;
unsigned short len; unsigned short len;
@@ -2908,6 +2908,8 @@ static WMArray *getStreamObjects(WMText * tPtr, int sel)
if (!stream) if (!stream)
return NULL; return NULL;
array = WMCreateArrayWithDestructor(4, releaseStreamObjects);
start = stream; start = stream;
while (start) { while (start) {