[gnumeric] xlsx: plug leak



commit f28b949e865b346fdd7d9f3175aa409b56587cd1
Author: Morten Welinder <terra gnome org>
Date:   Mon Feb 16 17:46:37 2015 -0500

    xlsx: plug leak

 plugins/excel/ChangeLog            |    1 +
 plugins/excel/xlsx-write-drawing.c |   13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 5e78881..e08bfaf 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,6 +1,7 @@
 2015-02-16  Morten Welinder  <terra gnome org>
 
        * xlsx-write-drawing.c (xlsx_write_one_plot): Plug leak.
+       (xlsx_write_plot_1_5_type): Plug leak.
 
 2015-02-14  Morten Welinder  <terra gnome org>
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 7f40c6f..bd0ea02 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -69,15 +69,18 @@ xlsx_write_chart_float (GsfXMLOut *xml, char const *name, double def_val, double
 static void
 xlsx_write_plot_1_5_type (GsfXMLOut *xml, GogObject const *plot, gboolean is_barcol)
 {
-       char const *type;
+       char *type;
+       const char *gtype;
+
        g_object_get (G_OBJECT (plot), "type", &type, NULL);
        if (0 == strcmp (type, "as_percentage"))
-               type = "percentStacked";
+               gtype = "percentStacked";
        else if (0 == strcmp (type, "stacked"))
-               type = "stacked";
+               gtype = "stacked";
        else
-               type = (is_barcol)? "clustered": "standard";
-       xlsx_write_chart_cstr_unchecked (xml, "c:grouping", type);
+               gtype = is_barcol ? "clustered": "standard";
+       xlsx_write_chart_cstr_unchecked (xml, "c:grouping", gtype);
+       g_free (type);
 }
 
 static void


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