From 4e47d1142a431f2c64437a7e47fc892a43c17d16 Mon Sep 17 00:00:00 2001
From: Federico Mena Quintero <federico@helixcode.com>
Date: Fri, 8 Dec 2000 21:09:04 +0000
Subject: Free the strings we get from the editables.

2000-12-08  Federico Mena Quintero  <federico@helixcode.com>

	* gui/event-editor.c (dialog_to_comp_object): Free the strings we
	get from the editables.

	* gui/dialogs/task-editor.c (dialog_to_comp_object): Likewise.
	This sucks; this code should be shared between the two dialogs.

svn path=/trunk/; revision=6868
---
 calendar/gui/event-editor.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'calendar/gui/event-editor.c')

diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 0d98d75d24..8939e9bb64 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -2150,7 +2150,7 @@ dialog_to_comp_object (EventEditor *ee, CalComponent *comp)
 	/* Summary */
 
 	str = e_dialog_editable_get (priv->general_summary);
-	if (strlen (str) == 0)
+	if (!str || strlen (str) == 0)
 		cal_component_set_summary (comp, NULL);
 	else {
 		CalComponentText text;
@@ -2161,10 +2161,13 @@ dialog_to_comp_object (EventEditor *ee, CalComponent *comp)
 		cal_component_set_summary (comp, &text);
 	}
 
+	if (str)
+		g_free (str);
+
 	/* Description */
 
 	str = e_dialog_editable_get (priv->description);
-	if (strlen (str) == 0)
+	if (!str || strlen (str) == 0)
 		cal_component_set_description_list (comp, NULL);
 	else {
 		GSList l;
@@ -2177,7 +2180,9 @@ dialog_to_comp_object (EventEditor *ee, CalComponent *comp)
 
 		cal_component_set_description_list (comp, &l);
 	}
-	/* FIXME: Do we need to free str?? */
+	
+	if (!str)
+		g_free (str);
 
 	/* Dates */
 	
-- 
cgit v1.2.3