addedd gcc-4.4.0
[dottout.git] / dev-libs / glib / files / glib-2.18.1-gdesktopappinfo-memleak-fix.patch
blob473fcbd27a1e048943d955ee3c2f871291a582ef
1 2008-09-20 Matthias Clasen
3 * gdesktopappinfo.c (expand_macro_single): Plug a memory leak
5 --- branches/glib-2-18/gio/gdesktopappinfo.c 2008/09/21 00:00:18 7520
6 +++ branches/glib-2-18/gio/gdesktopappinfo.c 2008/09/21 00:04:37 7521
7 @@ -480,7 +480,7 @@
9 GFile *file;
10 char *result = NULL;
11 - char *path;
12 + char *path, *name;
14 file = g_file_new_for_uri (uri);
15 path = g_file_get_path (file);
16 @@ -500,12 +500,20 @@
17 case 'd':
18 case 'D':
19 if (path)
20 - result = g_shell_quote (g_path_get_dirname (path));
21 + {
22 + name = g_path_get_dirname (path);
23 + result = g_shell_quote (name);
24 + g_free (name);
25 + }
26 break;
27 case 'n':
28 case 'N':
29 if (path)
30 - result = g_shell_quote (g_path_get_basename (path));
31 + {
32 + name = g_path_get_basename (path);
33 + result = g_shell_quote (name);
34 + g_free (name);
35 + }
36 break;