From 130d8f010f41432b35ba9413aaba375381dc07b6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 21 Sep 2008 00:00:18 +0000 Subject: [PATCH] Plug a memory leak svn path=/trunk/; revision=7520 --- gio/ChangeLog | 4 ++++ gio/gdesktopappinfo.c | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index afbfdd9..db2c42c 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,7 @@ +2008-09-20 Matthias Clasen + + * gdesktopappinfo.c (expand_macro_single): Plug a memory leak + 2008-09-17 Matthias Clasen * === Released 2.18.1 === diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 59890e4..0bab123 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -480,7 +480,7 @@ expand_macro_single (char macro, char *uri) { GFile *file; char *result = NULL; - char *path; + char *path, *name; file = g_file_new_for_uri (uri); path = g_file_get_path (file); @@ -500,12 +500,20 @@ expand_macro_single (char macro, char *uri) case 'd': case 'D': if (path) - result = g_shell_quote (g_path_get_dirname (path)); + { + name = g_path_get_dirname (path); + result = g_shell_quote (name); + g_free (name); + } break; case 'n': case 'N': if (path) - result = g_shell_quote (g_path_get_basename (path)); + { + name = g_path_get_basename (path); + result = g_shell_quote (name); + g_free (name); + } break; } -- 2.7.4