summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-22 10:30:10 +0200
committerrbuj <[email protected]>2021-12-23 10:15:54 +0100
commit8c9fed14c10e8cf125a7760bdc2cbc58282de64c (patch)
treeb1d2de0470efb018383b146530d84d9a971eaeba
parentb162c1fbdfedb791aa2a914555488e78eed91378 (diff)
downloadengrampa-dlg-package-installer-memory-leak.tar.bz2
engrampa-dlg-package-installer-memory-leak.tar.xz
file-data: fix memory leakdlg-package-installer-memory-leak
-rw-r--r--src/file-data.c11
-rw-r--r--src/fr-command-tar.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/file-data.c b/src/file-data.c
index 911a5e9..cc0832f 100644
--- a/src/file-data.c
+++ b/src/file-data.c
@@ -103,10 +103,15 @@ file_data_get_type (void)
void
file_data_update_content_type (FileData *fdata)
{
- if (fdata->dir)
+ if (fdata->dir) {
fdata->content_type = MIME_TYPE_DIRECTORY;
- else
- fdata->content_type = get_static_string (g_content_type_guess (fdata->full_path, NULL, 0, NULL));
+ } else {
+ char *content_type;
+
+ content_type = g_content_type_guess (fdata->full_path, NULL, 0, NULL);
+ fdata->content_type = get_static_string (content_type);
+ g_free (content_type);
+ }
}
diff --git a/src/fr-command-tar.c b/src/fr-command-tar.c
index b61dffc..6f7943f 100644
--- a/src/fr-command-tar.c
+++ b/src/fr-command-tar.c
@@ -141,8 +141,6 @@ process_line (char *line,
g_free (name);
name = g_filename_from_utf8 (fdata->original_path, -1, NULL, NULL, NULL);
if (name) {
- if (fdata->free_original_path)
- g_free (fdata->original_path);
fdata->original_path = g_strdup (name);
fdata->free_original_path = TRUE;
}