Exit action failed to free options struct
authorMikael Magnusson <mikachu@gmail.com>
Fri, 19 Feb 2010 22:24:52 +0000 (23:24 +0100)
committerMikael Magnusson <mikachu@gmail.com>
Fri, 19 Feb 2010 22:26:59 +0000 (23:26 +0100)
openbox/actions/exit.c

index 567926e..f447830 100644 (file)
@@ -10,11 +10,12 @@ typedef struct {
 
 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
 static gboolean run_func(ObActionsData *data, gpointer options);
+static void free_func(gpointer options);
 
 void action_exit_startup(void)
 {
-    actions_register("Exit", setup_func, NULL, run_func, NULL, NULL);
-    actions_register("SessionLogout", setup_func, NULL, run_func, NULL, NULL);
+    actions_register("Exit", setup_func, free_func, run_func, NULL, NULL);
+    actions_register("SessionLogout", setup_func, free_func, run_func, NULL, NULL);
 }
 
 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
@@ -31,6 +32,12 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     return o;
 }
 
+static void free_func(gpointer options)
+{
+    if (options)
+        g_free(options);
+}
+
 static void do_exit(void)
 {
     if (session_connected())