]> Dogcows Code - chaz/openbox/commitdiff
Fix small leak in If action option parsing
authorMikael Magnusson <mikachu@gmail.com>
Sat, 9 Oct 2010 22:51:36 +0000 (00:51 +0200)
committerDana Jansens <danakj@orodu.net>
Mon, 24 Jan 2011 19:19:22 +0000 (14:19 -0500)
openbox/actions/if.c

index 28010d388b43b0479417bdb1c2d188528a03de29..0e055a98f0099ea95828388f100febbf17525a37 100644 (file)
@@ -98,13 +98,16 @@ static gpointer setup_func(xmlNodePtr node)
             o->decor_on = TRUE;
     }
     if ((n = obt_xml_find_node(node, "desktop"))) {
-        gchar *s = obt_xml_node_string(n);
-        if (!g_ascii_strcasecmp(s, "current"))
-            o->desktop_current = TRUE;
-        if (!g_ascii_strcasecmp(s, "other"))
-            o->desktop_other = TRUE;
-        else
-            o->desktop_number = atoi(s);
+        gchar *s;
+        if ((s = obt_xml_node_string(n))) {
+          if (!g_ascii_strcasecmp(s, "current"))
+              o->desktop_current = TRUE;
+          if (!g_ascii_strcasecmp(s, "other"))
+              o->desktop_other = TRUE;
+          else
+              o->desktop_number = atoi(s);
+          g_free(s);
+        }
     }
     if ((n = obt_xml_find_node(node, "omnipresent"))) {
         if (obt_xml_node_bool(n))
This page took 0.024165 seconds and 4 git commands to generate.