From a75699faefaa9b91ef78804e1b810f618ddf8825 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:46 +0200 Subject: [PATCH] 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 --- src/dialog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialog.c b/src/dialog.c index 6b26aef8..90e7192b 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -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, "/");