[gnumeric] xlsx: plug leaks.



commit 7e7424899e43bd8c84ea697c82e5d13987230cc5
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 10 14:10:49 2015 -0500

    xlsx: plug leaks.

 plugins/excel/xlsx-write.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 0905577..34f4148 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -3106,6 +3106,7 @@ xlsx_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        XLSXWriteState state;
        GsfOutfile *root_part;
        GnmLocale  *locale;
+       GsfOutfile *zip;
 
        locale = gnm_push_C_locale ();
 
@@ -3116,8 +3117,9 @@ xlsx_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        state.custom_prop_id    = 29;
        state.drawing_elem_id   = 1024;
 
-       root_part = gsf_outfile_open_pkg_new (
-               gsf_outfile_zip_new (output, NULL));
+       zip = gsf_outfile_zip_new (output, NULL);
+       root_part = gsf_outfile_open_pkg_new (zip);
+       g_object_unref (zip);
 
        xlsx_write_workbook (&state, root_part);
        gsf_output_close (GSF_OUTPUT (root_part));
@@ -3136,6 +3138,7 @@ xlsx2_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        XLSXWriteState state;
        GsfOutfile *root_part;
        GnmLocale  *locale;
+       GsfOutfile *zip;
 
        locale = gnm_push_C_locale ();
        state.version           = ECMA_376_2008;
@@ -3145,8 +3148,9 @@ xlsx2_file_save (G_GNUC_UNUSED GOFileSaver const *fs, GOIOContext *io_context,
        state.custom_prop_id    = 29;
        state.drawing_elem_id   = 1024;
 
-       root_part = gsf_outfile_open_pkg_new (
-               gsf_outfile_zip_new (output, NULL));
+       zip = gsf_outfile_zip_new (output, NULL);
+       root_part = gsf_outfile_open_pkg_new (zip);
+       g_object_unref (zip);
 
        xlsx_write_workbook (&state, root_part);
        gsf_output_close (GSF_OUTPUT (root_part));


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