diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2013-08-30 10:11:38 +0800 |
---|---|---|
committer | LAN-TW <lantw44@gmail.com> | 2013-08-30 10:43:55 +0800 |
commit | aa3e62c09703f1f67b695eeca5cbf3e7f30f3ce0 (patch) | |
tree | 61332a40f8d93e4346d485f15a305a9e7a90f53b | |
parent | 2728ab336eda6be405519e46d020e75866662964 (diff) | |
download | gsoc2013-libgnome-autoar-aa3e62c09703f1f67b695eeca5cbf3e7f30f3ce0.tar.gz gsoc2013-libgnome-autoar-aa3e62c09703f1f67b695eeca5cbf3e7f30f3ce0.tar.zst gsoc2013-libgnome-autoar-aa3e62c09703f1f67b695eeca5cbf3e7f30f3ce0.zip |
Fix memory leak
-rw-r--r-- | gnome-autoar/autoar-extract.c | 1 | ||||
-rw-r--r-- | gnome-autoar/autoar-pref.c | 4 | ||||
-rw-r--r-- | tests/test-pref.c | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/gnome-autoar/autoar-extract.c b/gnome-autoar/autoar-extract.c index 529c3f8..9de45a6 100644 --- a/gnome-autoar/autoar-extract.c +++ b/gnome-autoar/autoar-extract.c @@ -1374,6 +1374,7 @@ autoar_extract_new_full (const char *source, char *source_basename = g_file_get_basename (arextract->priv->source_file); arextract->priv->suggested_destname = autoar_common_get_basename_remove_extension (source_basename); + g_free (source_basename); } g_free (gen_source); diff --git a/gnome-autoar/autoar-pref.c b/gnome-autoar/autoar-pref.c index 252ac75..ed563bc 100644 --- a/gnome-autoar/autoar-pref.c +++ b/gnome-autoar/autoar-pref.c @@ -555,7 +555,7 @@ autoar_pref_check_mime_type_file (AutoarPref *arpref, { GFileInfo *fileinfo; const char *content_type; - const char *mime_type; + char *mime_type; gboolean result; g_return_val_if_fail (AUTOAR_IS_PREF (arpref), FALSE); @@ -576,6 +576,8 @@ autoar_pref_check_mime_type_file (AutoarPref *arpref, g_debug ("MIME Type: %s\n", mime_type); result = autoar_pref_check_mime_type_d (arpref, mime_type); + + g_free (mime_type); g_object_unref (fileinfo); return result; diff --git a/tests/test-pref.c b/tests/test-pref.c index b5d317e..af8f8e1 100644 --- a/tests/test-pref.c +++ b/tests/test-pref.c @@ -26,6 +26,7 @@ main (int argc, autoar_pref_check_mime_type (arpref, argv[1]), autoar_pref_check_mime_type_file (arpref, file)); + g_object_unref (settings); g_object_unref (arpref); g_object_unref (file); |