[gnumeric] Plug leak 698559



commit 7b0902686b1ca310d5bde42d418b05ce74bfa281
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Apr 22 09:52:52 2013 -0600

    Plug leak 698559
    
    2013-04-22  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-write.c (col_row_styles_free): new
        (openoffice_file_save_real): use col_row_styles_free
        to free the styles lists

 NEWS                                  |  1 +
 plugins/openoffice/ChangeLog          |  6 ++++++
 plugins/openoffice/openoffice-write.c | 15 +++++++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 35b883b..fa326bd 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Andreas:
        * Don't insert ODF local tables as sheets. [#698388]
        * Improve import of header/footer info from ODF.
        * Fix legend placement in ODF import. [#698535]
+       * Plug leaks.
 
 Dominique Leuenberger:
        * Fix locale directory.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 2aa3e0a..505875e 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-22  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-write.c (col_row_styles_free): new
+       (openoffice_file_save_real): use col_row_styles_free
+       to free the styles lists
+
 2013-04-22  Morten Welinder  <terra gnome org>
 
        * openoffice-read.c (odf_text_span_end): Plug leak.
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 0fee98a..173a5b4 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -1701,6 +1701,17 @@ odf_compare_ci (gconstpointer a, gconstpointer b)
 }
 
 static void
+col_row_styles_free (gpointer data)
+{
+       col_row_styles_t *style = data;
+
+       if (data) {
+               g_free (style->name);
+               g_free (style);
+       }
+}
+
+static void
 odf_write_row_style (GnmOOExport *state, ColRowInfo const *ci)
 {
        gsf_xml_out_start_element (state->xml, STYLE "table-row-properties");
@@ -8183,8 +8194,8 @@ openoffice_file_save_real (G_GNUC_UNUSED  GOFileSaver const *fs, GOIOContext *io
        g_hash_table_unref (state.graph_fill_images);
        g_hash_table_unref (state.arrow_markers);
        g_hash_table_unref (state.text_colours);
-       g_slist_free (state.col_styles);
-       g_slist_free (state.row_styles);
+       g_slist_free_full (state.col_styles,  col_row_styles_free);
+       g_slist_free_full (state.row_styles,  col_row_styles_free);
        if (state.default_style_region)
                gnm_style_region_free (state.default_style_region);
        go_format_unref (state.time_fmt);


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