[gnumeric] xlsx: plug leaks.



commit 61ffe669163e8497e099ecedb0a39eac84ec79e0
Author: Morten Welinder <terra gnome org>
Date:   Fri Oct 24 18:44:33 2014 -0400

    xlsx: plug leaks.

 NEWS                              |    2 +-
 plugins/excel/ChangeLog           |    6 ++++++
 plugins/excel/xlsx-read-drawing.c |    7 +++++--
 plugins/excel/xlsx-read.c         |    4 ++--
 4 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6832446..850d925 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 Gnumeric 1.12.19
 
 Morten:
-       * Plug leak.
+       * Plug leaks.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.18
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index c01eed7..47c1595 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-24  Morten Welinder  <terra gnome org>
+
+       * xlsx-read.c (xlsx_file_open): Plug leak.
+
+       * xlsx-read-drawing.c (cb_axis_set_position): Plus leak.
+
 2014-09-25  Morten Welinder <terra gnome org>
 
        * Release 1.12.18
diff --git a/plugins/excel/xlsx-read-drawing.c b/plugins/excel/xlsx-read-drawing.c
index 2ddae1c..e287efc 100644
--- a/plugins/excel/xlsx-read-drawing.c
+++ b/plugins/excel/xlsx-read-drawing.c
@@ -2028,13 +2028,16 @@ cb_axis_set_position (GObject *axis, XLSXAxisInfo *info,
                GogAxis *visible = NULL;
 
                for (cur = l; cur; cur = cur->next) {
+                       GogAxis *axis = GOG_AXIS (cur->data);
                        gboolean invisible;
-                       g_object_get (cur->data, "invisible", &invisible, NULL);
+                       g_object_get (axis, "invisible", &invisible, NULL);
                        if (!invisible) {
-                               visible = GOG_AXIS (cur->data);
+                               visible = axis;
                                break;
                        }
                }
+               g_slist_free (l);
+
                if (visible) {
                        GSList *l1, *cur1;
 
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index dbc97a1..0250d0b 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1321,7 +1321,7 @@ xlsx_cell_inline_text_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 static void
 xlsx_cell_inline_begin (GsfXMLIn *xin, xmlChar const **attrs)
 {
-       XLSXReadState   *state = (XLSXReadState *)xin->user_state;
+       XLSXReadState *state = (XLSXReadState *)xin->user_state;
 
        state->r_text = g_string_new ("");
 }
@@ -1330,7 +1330,6 @@ static void
 xlsx_cell_inline_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
-       XLSXStr *entry;
 
        state->val = value_new_string_nocopy (g_string_free (state->r_text, FALSE));
        state->r_text = NULL;
@@ -5049,6 +5048,7 @@ xlsx_file_open (G_GNUC_UNUSED GOFileOpener const *fo, GOIOContext *context,
        g_hash_table_destroy (state.theme_colors_by_name);
        value_release (state.val);
        if (state.texpr) gnm_expr_top_unref (state.texpr);
+       if (state.comment) g_object_unref (state.comment);
 
        workbook_set_saveinfo (state.wb, GO_FILE_FL_AUTO,
                               go_file_saver_for_id ((state.version == ECMA_376_2006) ?


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