[devilspie] Fix memory leak



commit 6b1af1227658ac333bfab407e02f3de6452d6de1
Author: Andreas Rönnquist <gusnan gusnan se>
Date:   Wed May 8 10:38:54 2013 +0200

    Fix memory leak

 src/xutils.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/xutils.c b/src/xutils.c
index ed3726a..f8672a1 100644
--- a/src/xutils.c
+++ b/src/xutils.c
@@ -286,13 +286,14 @@ my_wnck_get_viewport_start (WnckWindow *win)
 {
   gulong *list;
   int len;
+  int result = -1;
 
   my_wnck_get_cardinal_list (RootWindowOfScreen (my_wnck_window_get_xscreen (win)),
                             my_wnck_atom_get ("_NET_DESKTOP_VIEWPORT"), &list, &len);
 
-  if (len > 0) {
-    return list[0];
-  } else {
-    return -1;
-  }
+  if (len > 0) result=list[0];
+
+  g_free(list);
+
+  return result;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]