diff src/dialogs.c @ 4630:5cdfd20daa07

[gaim-migrate @ 4921] Faceprint found these leaks. Anyone else want to find any? committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 01 Mar 2003 18:37:48 +0000
parents 9f92925b6507
children 42d53c416bb9
line wrap: on
line diff
--- a/src/dialogs.c	Sat Mar 01 02:30:24 2003 +0000
+++ b/src/dialogs.c	Sat Mar 01 18:37:48 2003 +0000
@@ -3532,6 +3532,7 @@
 
 int check_away_mess(struct create_away *ca, int type)
 {
+	char *msg;
 	if ((strlen(gtk_entry_get_text(GTK_ENTRY(ca->entry))) == 0) && (type == 1)) {
 		/* We shouldn't allow a blank title */
 		do_error_dialog(_("You cannot save an away message with a blank title"), 
@@ -3540,12 +3541,16 @@
 		return 0;
 	}
 
-	if (!gtk_text_view_get_text(GTK_TEXT_VIEW(ca->text), FALSE) && (type <= 1)) {
+	msg = gtk_text_view_get_text(GTK_TEXT_VIEW(ca->text), FALSE);
+
+	if (!msg && (type <= 1)) {
 		/* We shouldn't allow a blank message */
 		do_error_dialog(_("You cannot create an empty away message"), NULL, GAIM_ERROR);
 		return 0;
 	}
 
+	g_free(msg);
+
 	return 1;
 }