mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-06 05:44:11 +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:
committed by
Carlos R. Mafra
parent
0134720621
commit
6831daf427
@@ -2898,7 +2898,7 @@ static void releaseStreamObjects(void *data)
|
||||
|
||||
static WMArray *getStreamObjects(WMText * tPtr, int sel)
|
||||
{
|
||||
WMArray *array = WMCreateArrayWithDestructor(4, releaseStreamObjects);
|
||||
WMArray *array;
|
||||
WMData *data;
|
||||
char *stream;
|
||||
unsigned short len;
|
||||
@@ -2908,6 +2908,8 @@ static WMArray *getStreamObjects(WMText * tPtr, int sel)
|
||||
if (!stream)
|
||||
return NULL;
|
||||
|
||||
array = WMCreateArrayWithDestructor(4, releaseStreamObjects);
|
||||
|
||||
start = stream;
|
||||
while (start) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user