1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 14:42:29 +01:00

WMaker: fix possible memory leak in the icon chooser dialog (Coverity #50173)

As reported by Coverity, it was possible to return early from the function
'listCallback' without de-allocating a temporary string. The string is now
requested after this early return.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:46 +02:00
committed by Carlos R. Mafra
parent bec0272584
commit a75699faef

View File

@@ -664,13 +664,13 @@ static void listCallback(void *self, void *data)
if (item == NULL) if (item == NULL)
return; return;
path = item->text; path = item->text;
tmp = wexpandpath(path);
item = WMGetListSelectedItem(panel->iconList); item = WMGetListSelectedItem(panel->iconList);
if (item == NULL) if (item == NULL)
return; return;
iconFile = item->text; iconFile = item->text;
tmp = wexpandpath(path);
path = wmalloc(strlen(tmp) + strlen(iconFile) + 4); path = wmalloc(strlen(tmp) + strlen(iconFile) + 4);
strcpy(path, tmp); strcpy(path, tmp);
strcat(path, "/"); strcat(path, "/");