From 219315aa58ab2d4742d0893eaccaac9c027305c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Sat, 14 Apr 2012 12:11:34 +0200 Subject: [PATCH] WindowMaker: Check iconPath variable only if needed The variable iconPath should only checked inside the if block, because outside is never initialized. --- src/application.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/application.c b/src/application.c index 0b820789..584c0aaf 100644 --- a/src/application.c +++ b/src/application.c @@ -185,9 +185,9 @@ void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_cla void wApplicationExtractDirPackIcon(WScreen * scr, char *path, char *wm_instance, char *wm_class) { char *iconPath = NULL; - if (strstr(path, ".app")) { - char *tmp; + char *tmp = NULL; + if (strstr(path, ".app")) { tmp = wmalloc(strlen(path) + 16); if (scr->flags.supports_tiff) { @@ -206,11 +206,11 @@ void wApplicationExtractDirPackIcon(WScreen * scr, char *path, char *wm_instance if (!iconPath) wfree(tmp); - } - if (iconPath) { - wApplicationSaveIconPathFor(iconPath, wm_instance, wm_class); - wfree(iconPath); + if (iconPath) { + wApplicationSaveIconPathFor(iconPath, wm_instance, wm_class); + wfree(iconPath); + } } } -- 2.11.4.GIT