[libgsf] gsf: plug leak.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgsf] gsf: plug leak.
- Date: Sun, 23 Nov 2014 16:35:57 +0000 (UTC)
commit 66caf5d9a05be922371aee9cf000797a6bb396a8
Author: Morten Welinder <terra gnome org>
Date: Sat Nov 22 19:20:15 2014 -0500
gsf: plug leak.
ChangeLog | 2 ++
tools/gsf.c | 14 +++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 306fe15..6c49596 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2014-11-22 Morten Welinder <terra gnome org>
+ * tools/gsf.c (open_archive): Plug leak.
+
* gsf/gsf-infile-stdio.c (GsfInfileStdio): Use a GPtrArray instead
of a list for performance with large directories.
diff --git a/tools/gsf.c b/tools/gsf.c
index 6d3e68a..f8e58d5 100644
--- a/tools/gsf.c
+++ b/tools/gsf.c
@@ -51,22 +51,30 @@ open_archive (char const *filename)
}
infile = gsf_infile_zip_new (src, NULL);
- if (infile)
+ if (infile) {
+ g_object_unref (src);
return infile;
+ }
infile = gsf_infile_msole_new (src, NULL);
- if (infile)
+ if (infile) {
+ g_object_unref (src);
return infile;
+ }
infile = gsf_infile_tar_new (src, NULL);
- if (infile)
+ if (infile) {
+ g_object_unref (src);
return infile;
+ }
display_name = g_filename_display_name (filename);
g_printerr (_("%s: Failed to recognize %s as an archive\n"),
g_get_prgname (),
display_name);
g_free (display_name);
+
+ g_object_unref (src);
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]