[gnumeric] leaks



commit 357317551e82447f82f2da7ed0d5d0a8a325a60e
Author: Morten Welinder <terra gnome org>
Date:   Fri Dec 17 10:12:13 2010 -0500

    leaks

 NEWS                               |    1 +
 src/dialogs/ChangeLog              |   10 +++++++++-
 src/dialogs/dialog-printer-setup.c |   16 +++++++++++-----
 3 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 4798ac7..bfe9259 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ Jean:
 Morten:
 	* Fix array intersection problem with IF.  [#633433]
 	* Make sure columns are wide enough for dates in csv import.
+	* Plug a few leaks.
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.12
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 80f3ae0..47b6350 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-17  Morten Welinder  <terra gnome org>
+
+	* dialog-printer-setup.c (hf_insert_hf_stock_tag)
+	(hf_insert_hf_tag): Make "options" argument const to clarify
+	ownership rules.
+	(is_known_tag): Free "options".
+	(hf_insert_cell_cb): Plug leak.
+
 2010-11-25  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* regression.ui: added residuals checkbox
@@ -29,7 +37,7 @@
 2010-11-06  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* cell-sort.ui: add tooltip text for the checkboxes
-	
+
 2010-11-05  Jean Brefort  <jean brefort normalesup org>
 
 	* dialog-sheet-order.c (destroy_cb), (dialog_sheet_order): clear state on
diff --git a/src/dialogs/dialog-printer-setup.c b/src/dialogs/dialog-printer-setup.c
index 9b25b87..6b1bb80 100644
--- a/src/dialogs/dialog-printer-setup.c
+++ b/src/dialogs/dialog-printer-setup.c
@@ -1092,7 +1092,8 @@ hf_delete_tag_cb (HFCustomizeState *hf_state)
 
 
 static void
-hf_insert_hf_stock_tag (HFCustomizeState *hf_state, GtkTextBuffer *buffer, HFFieldType type, char *options)
+hf_insert_hf_stock_tag (HFCustomizeState *hf_state, GtkTextBuffer *buffer,
+			HFFieldType type, const char *options)
 {
 	GtkTextIter iter;
 	gchar const *stock_id;
@@ -1155,7 +1156,8 @@ hf_insert_hf_stock_tag (HFCustomizeState *hf_state, GtkTextBuffer *buffer, HFFie
 }
 
 static void
-hf_insert_hf_tag (HFCustomizeState *hf_state, HFFieldType type, char *options)
+hf_insert_hf_tag (HFCustomizeState *hf_state, HFFieldType type,
+		  const char *options)
 {
 	GtkWidget* focus;
 
@@ -1210,10 +1212,10 @@ hf_insert_custom_time_cb (GtkWidget *widget, HFCustomizeState *hf_state)
 static void
 hf_insert_cell_cb (GtkWidget *widget, HFCustomizeState *hf_state)
 {
-	char *options;
+	const char *options;
 	options = g_object_get_data (G_OBJECT (widget), "options");
 	if (options == NULL)
-		options = g_strdup ("A1");
+		options = "A1";
 	hf_insert_hf_tag (hf_state, HF_FIELD_CELL, options);
 }
 
@@ -1489,7 +1491,11 @@ is_known_tag (HFCustomizeState* hf_state, GtkTextBuffer *buffer, char const *tag
 		hf_insert_hf_stock_tag (hf_state, buffer, HF_FIELD_TIME, options);
 	else if (check_hf_tag (tag, "CELL", &options, length))
 		hf_insert_hf_stock_tag (hf_state, buffer, HF_FIELD_CELL, options);
-	else return FALSE;
+	else
+		return FALSE;
+
+	g_free (options);
+
 	return TRUE;
 }
 



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