[gnumeric] Sheet: plug leak.



commit 6c11a5edf4e6aaf38f398efc601fe97762e95c7a
Author: Morten Welinder <terra gnome org>
Date:   Mon Oct 27 20:52:59 2014 -0400

    Sheet: plug leak.

 ChangeLog   |    9 +++++++--
 NEWS        |    3 +++
 src/sheet.c |    7 ++-----
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b1c54f2..d20925b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
+2014-10-27  Morten Welinder  <terra gnome org>
+
+       * src/sheet.c (sheet_destroy_contents): Plug leak from fuzzed
+       code.
+
 2014-10-27  Jean Brefort  <jean brefort normalesup org>
 
        * src/item-cursor.c (cb_item_cursor_animation): use
-       goc_canvas_invalidate_region() for ants walking. Avoid drawing outside of a
-       draw event.
+       goc_canvas_invalidate_region() for ants walking.  Avoid drawing
+       outside of a draw event.
 
 2014-10-26  Morten Welinder  <terra gnome org>
 
diff --git a/NEWS b/NEWS
index aa36429..f52c5bc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.19
 
+Jean:
+       * Fix ants problems.
+
 Morten:
        * Plug leaks.
        * Pay more attention to union access rules.
diff --git a/src/sheet.c b/src/sheet.c
index 2135051..fddd26a 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -4516,9 +4516,6 @@ cb_remove_allcells (G_GNUC_UNUSED gpointer ignore0, GnmCell *cell, G_GNUC_UNUSED
 void
 sheet_destroy_contents (Sheet *sheet)
 {
-       /* Save these because they are going to get zeroed. */
-       int const max_col = sheet->cols.max_used;
-       int const max_row = sheet->rows.max_used;
        GSList *filters;
        int i;
 
@@ -4571,10 +4568,10 @@ sheet_destroy_contents (Sheet *sheet)
        g_hash_table_destroy (sheet->cell_hash);
 
        /* Delete in ascending order to avoid decrementing max_used each time */
-       for (i = 0; i <= max_col; ++i)
+       for (i = 0; i <= sheet->cols.max_used; ++i)
                sheet_col_destroy (sheet, i, FALSE);
 
-       for (i = 0; i <= max_row; ++i)
+       for (i = 0; i <= sheet->rows.max_used; ++i)
                sheet_row_destroy (sheet, i, FALSE);
 
        /* Free segments too */


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