[gnumeric] fix leak [#698471]



commit 60600b65cc80c6299a819de20031e6a817c82618
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Sun Apr 21 21:14:17 2013 -0600

    fix leak [#698471]
    
    2013-04-21  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_header_footer_end): fix leak
        (odf_hf_file): don't try to circumvent the GString handling

 plugins/openoffice/ChangeLog         | 5 +++++
 plugins/openoffice/openoffice-read.c | 6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 5a03f02..018d035 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
 2013-04-21  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-read.c (odf_header_footer_end): fix leak
+       (odf_hf_file): don't try to circumvent the GString handling
+
+2013-04-21  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-read.c (od_draw_object): delete tables created during
        parsing of objects.
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 14395e6..cab6d80 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -5709,6 +5709,7 @@ odf_header_footer_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
        if (state->text_p_stack) {
                oo_text_p_t *ptr = state->text_p_stack->data;
                if (ptr->gstr) {
+                       g_free (*(state->print.cur_hf_format));
                        *(state->print.cur_hf_format) = g_string_free (ptr->gstr, FALSE);
                        ptr->gstr = NULL;
                }
@@ -5859,7 +5860,6 @@ odf_hf_file (GsfXMLIn *xin, xmlChar const **attrs)
        };
        OOParseState *state = (OOParseState *)xin->user_state;
        int tmp = 2;
-       char *new;
 
        if (state->print.cur_hf_format == NULL)
                return;
@@ -5870,9 +5870,7 @@ odf_hf_file (GsfXMLIn *xin, xmlChar const **attrs)
        switch (tmp) {
        case 0:
                odf_hf_item (xin, _("path"));
-               new = g_strconcat (*(state->print.cur_hf_format), "/", NULL);
-               g_free (*(state->print.cur_hf_format));
-               *(state->print.cur_hf_format) = new;
+               odf_text_p_add_text (state, "/");
                odf_hf_item (xin, _("file"));
                break;
        case 1:


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