diff options
author | rbuj <[email protected]> | 2020-08-04 14:43:12 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-08-05 11:55:24 +0200 |
commit | 16ffeaf0a87f53b2ebbb679c2899fc472693f421 (patch) | |
tree | d064677a987bae630187ca132ae47a593e282344 | |
parent | 02eb194124d379c0eda858d6f3803b840732edc1 (diff) | |
download | mate-panel-16ffeaf0a87f53b2ebbb679c2899fc472693f421.tar.bz2 mate-panel-16ffeaf0a87f53b2ebbb679c2899fc472693f421.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 03d7143d..7215c357 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); } |