[gnumeric] xlsx: plug leaks.



commit a19f4a4a14d625f844167f9ffd571b1ff5c9d767
Author: Morten Welinder <terra gnome org>
Date:   Sun Feb 1 19:02:12 2015 -0500

    xlsx: plug leaks.

 NEWS                      |    1 +
 plugins/excel/ChangeLog   |    4 ++++
 plugins/excel/xlsx-read.c |   12 ++++++++----
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index f481f5e..ca5d44a 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Morten:
        * Fix xlsx problem with inverted axis.
        * Export sliders as scrollbars for xls.
        * Fix xls loading of horizontal scrollbars.  [#743754]
+       * Plug leaks.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.19
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 32778c5..bf1e628 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2015-02-01  Morten Welinder  <terra gnome org>
+
+       * xlsx-read.c (xlsx_comment_end): Plug leak.
+
 2015-01-30  Morten Welinder  <terra gnome org>
 
        * ms-obj.c (ms_obj_read_biff8_obj): Gather orientation.
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index dcb6e79..a5990bb 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -3818,6 +3818,7 @@ xlsx_comment_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
                state->rich_attrs = NULL;
        }
        sheet_object_set_sheet (SHEET_OBJECT (state->comment), state->sheet);
+       g_object_unref (state->comment);
        state->comment = NULL;
 
        maybe_update_progress (xin);
@@ -5006,10 +5007,12 @@ xlsx_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *context,
 
                        in = gsf_open_pkg_open_rel_by_type (wb_part,
                                "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";, 
NULL);
-                       start_update_progress (&state, in, _("Reading theme..."),
-                                              0.05, 0.1);
-                       xlsx_parse_stream (&state, in, xlsx_theme_dtd);
-                       end_update_progress (&state);
+                       if (in) {
+                               start_update_progress (&state, in, _("Reading theme..."),
+                                                      0.05, 0.1);
+                               xlsx_parse_stream (&state, in, xlsx_theme_dtd);
+                               end_update_progress (&state);
+                       }
 
                        in = gsf_open_pkg_open_rel_by_type (wb_part,
                                "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";, 
NULL);
@@ -5030,6 +5033,7 @@ xlsx_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *context,
                } else
                        go_cmd_context_error_import (GO_CMD_CONTEXT (context),
                                _("No workbook stream found."));
+
                g_object_unref (state.zip);
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]