diff options
author | rbuj <[email protected]> | 2020-08-04 14:43:12 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2020-08-05 06:23:49 +0000 |
commit | 1c72cac05bf6c42cd6aa0832e398254a5107f5b8 (patch) | |
tree | edf218edeb3370efd9088dbe67ebaab12c72f28b | |
parent | 7d706e9fe1f53ef73f644eb1a6488239541d6714 (diff) | |
download | mate-panel-1c72cac05bf6c42cd6aa0832e398254a5107f5b8.tar.bz2 mate-panel-1c72cac05bf6c42cd6aa0832e398254a5107f5b8.tar.xz |
launcher: Fix memory leak
-rw-r--r-- | mate-panel/launcher.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mate-panel/launcher.c b/mate-panel/launcher.c index 3c1886a4..848d92ae 100644 --- a/mate-panel/launcher.c +++ b/mate-panel/launcher.c @@ -665,7 +665,6 @@ panel_launcher_find_writable_uri (const char *launcher_location, { char *path; char *uri; - char *filename; if (!launcher_location) return panel_make_unique_desktop_uri (NULL, source); @@ -677,8 +676,9 @@ panel_launcher_find_writable_uri (const char *launcher_location, return uri; } - filename = panel_launcher_get_filename (launcher_location); + char *filename = panel_launcher_get_filename (launcher_location); if (filename != NULL) { + g_free (filename); /* we have a file in the user directory. We either have a path * or an URI */ if (g_path_is_absolute (launcher_location)) @@ -688,8 +688,6 @@ panel_launcher_find_writable_uri (const char *launcher_location, return g_strdup (launcher_location); } - g_free (filename); - return panel_make_unique_desktop_uri (NULL, source); } |