From 41b59f07a56787784a97da8b20fa913027152c03 Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 23 Dec 2012 15:24:31 +0200 Subject: [PATCH] * mu-cmd-script.c: fix small leak --- mu/mu-cmd-script.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mu/mu-cmd-script.c b/mu/mu-cmd-script.c index 0f6ad192..159be9d4 100644 --- a/mu/mu-cmd-script.c +++ b/mu/mu-cmd-script.c @@ -114,15 +114,20 @@ get_script_info_list (const char *muhome, GError **err) "scripts" G_DIR_SEPARATOR_S "stats"); /* is there are userdir for scripts? */ - if (!mu_util_check_dir (userpath, TRUE, FALSE)) + if (!mu_util_check_dir (userpath, TRUE, FALSE)) { + g_free (userpath); return scripts; + } /* append it to the list we already have */ userscripts = mu_script_get_script_info_list (userpath, MU_GUILE_EXT, MU_GUILE_DESCR_PREFIX, err); + g_free (userpath); + /* some error, return nothing */ if (err && *err) { + mu_script_info_list_destroy (userscripts); mu_script_info_list_destroy (scripts); return NULL; }