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:
committed by
Carlos R. Mafra
parent
bec0272584
commit
a75699faef
@@ -664,13 +664,13 @@ static void listCallback(void *self, void *data)
|
||||
if (item == NULL)
|
||||
return;
|
||||
path = item->text;
|
||||
tmp = wexpandpath(path);
|
||||
|
||||
item = WMGetListSelectedItem(panel->iconList);
|
||||
if (item == NULL)
|
||||
return;
|
||||
iconFile = item->text;
|
||||
|
||||
tmp = wexpandpath(path);
|
||||
path = wmalloc(strlen(tmp) + strlen(iconFile) + 4);
|
||||
strcpy(path, tmp);
|
||||
strcat(path, "/");
|
||||
|
||||
Reference in New Issue
Block a user