>From 64aa0eca31af8b5bfb3f16a7be6774edb9f9ca97 Mon Sep 17 00:00:00 2001
From: Tobias Stoeckmann <[email protected]>
Date: Sat, 5 May 2012 09:44:42 +0200
Subject: [PATCH] Easier error path in wDockTrackWindowLaunch.

There is no need to allocate command if the very next line might
fail independently from comand, freeing that memory again in error path.
---
 src/dock.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/dock.c b/src/dock.c
index 9d12814..3b5c121 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2863,15 +2863,11 @@ void wDockTrackWindowLaunch(WDock *dock, Window window)
        Bool found = False;
        char *command = NULL;
 
-       command = GetCommandForWindow(window);
-
        if (!PropGetWMClass(window, &wm_class, &wm_instance) || (!wm_class && 
!wm_instance)) {
-
-               if (command)
-                       wfree(command);
                return;
        }
 
+       command = GetCommandForWindow(window);
  retry:
        for (i = 0; i < dock->max_icons; i++) {
                icon = dock->icon_array[i];
-- 
1.7.6


-- 
To unsubscribe, send mail to [email protected].

Reply via email to