[gnumeric] ods: plug leak.



commit ed160852c060c76600b8d419ce74d6e9aeb009dc
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 17 15:03:35 2015 -0500

    ods: plug leak.

 plugins/openoffice/openoffice-write.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index b233ac0..5ff9551 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -5165,6 +5165,17 @@ static render_ops_t odf_render_ops_to_xl [] = {
        { NULL, NULL, NULL },
 };
 
+static void
+ods_render_ops_clear (render_ops_t *render_ops)
+{
+       int i;
+
+       for (i = 0; render_ops [i].name; i++) {
+               g_free (render_ops[i].name);
+               render_ops[i].name =  NULL;
+       }
+}
+
 /*
  * Renders an opcode.  The opcodes can take an argument by adding trailing ':'
  * to the opcode and then a number format code
@@ -8953,6 +8964,9 @@ openoffice_file_save_real (G_GNUC_UNUSED  GOFileSaver const *fs, GOIOContext *io
        go_format_unref (state.time_fmt);
        go_format_unref (state.date_fmt);
        go_format_unref (state.date_long_fmt);
+
+       ods_render_ops_clear (odf_render_ops);
+       ods_render_ops_clear (odf_render_ops_to_xl);
 }
 
 


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