From 8208e67d8920076cc0eae3d4098fe1c3979c13ae Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 19 Feb 2010 23:24:52 +0100 Subject: [PATCH] Exit action failed to free options struct --- openbox/actions/exit.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 567926e1..f447830c 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -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()) -- 2.34.1