diff options
author | rbuj <[email protected]> | 2021-10-21 21:34:05 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-04 20:00:19 +0200 |
commit | c0fadd464f227e7ebbfefd3fa54e578f1bb9998b (patch) | |
tree | af04a82cdfcad70af83f85dbcf6d21d69ba10c92 | |
parent | da64dd31f77a8082650d0904da19a21dfc400ae1 (diff) | |
download | engrampa-c0fadd464f227e7ebbfefd3fa54e578f1bb9998b.tar.bz2 engrampa-c0fadd464f227e7ebbfefd3fa54e578f1bb9998b.tar.xz |
fr-window: fix memory leak
-rw-r--r-- | src/fr-window.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fr-window.c b/src/fr-window.c index 9a30f5e..b5b5cff 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -560,6 +560,7 @@ fr_window_free_private_data (FrWindow *window) g_free (window->priv->add_default_dir); g_free (window->priv->extract_default_dir); g_free (window->priv->archive_uri); + g_free (window->priv->working_archive); g_free (window->priv->password); g_free (window->priv->password_for_paste); @@ -981,7 +982,7 @@ sort_by_type (gconstpointer ptr1, FileData *fdata1 = *((FileData **) ptr1); FileData *fdata2 = *((FileData **) ptr2); int result; - const char *desc1, *desc2; + char *desc1, *desc2; if (file_data_is_dir (fdata1) != file_data_is_dir (fdata2)) { if (file_data_is_dir (fdata1)) @@ -996,6 +997,9 @@ sort_by_type (gconstpointer ptr1, desc2 = g_content_type_get_description (fdata2->content_type); result = strcasecmp (desc1, desc2); + g_free (desc1); + g_free (desc2); + if (result == 0) return sort_by_name (ptr1, ptr2); else @@ -1560,7 +1564,7 @@ fr_window_populate_file_list (FrWindow *window, char *utf8_path; char *s_size; char *s_time; - const char *desc; + char *desc; utf8_path = g_filename_display_name (fdata->path); @@ -1583,6 +1587,7 @@ fr_window_populate_file_list (FrWindow *window, g_free (utf8_path); g_free (s_size); g_free (s_time); + g_free (desc); } g_free (utf8_name); if (icon != NULL) @@ -2414,9 +2419,10 @@ fr_window_working_archive_cb (FrCommand *command, FrWindow *window) { g_free (window->priv->working_archive); - window->priv->working_archive = NULL; if (archive_filename != NULL) window->priv->working_archive = g_strdup (archive_filename); + else + window->priv->working_archive = NULL; progress_dialog_update_action_description (window); return TRUE; @@ -2875,6 +2881,7 @@ fr_window_add_to_recent_list (FrWindow *window, recent_data->app_exec = "engrampa"; gtk_recent_manager_add_full (gtk_recent_manager_get_default (), uri, recent_data); + g_free (recent_data->mime_type); g_free (recent_data); } else |