Plug a memory leak

svn path=/branches/glib-2-18/; revision=7521
This commit is contained in:
Matthias Clasen 2008-09-21 00:04:37 +00:00
parent fd0e923a15
commit da47e8f8ae
2 changed files with 17 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2008-09-20 Matthias Clasen <mclasen@redhat.com>
Merged from trunk:
* gdesktopappinfo.c (expand_macro_single): Plug a memory leak
2008-09-17 Matthias Clasen <mclasen@redhat.com>
* === Released 2.18.1 ===

View File

@ -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;
}