From 74f7f35b59ce395c17fa823660a480dd94c6077c Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 10 Oct 2010 00:51:36 +0200 Subject: [PATCH] Fix small leak in If action option parsing --- openbox/actions/if.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/openbox/actions/if.c b/openbox/actions/if.c index 28010d38..0e055a98 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -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)) -- 2.39.2