# HG changeset patch # User Sadrul Habib Chowdhury # Date 1246081543 0 # Node ID 25db53cfc12c6d8eb5f253c56613a03bb3cbf2b0 # Parent 57ea320e272736910d7d20d2c62fe7d28047ea58 Make sure uninitialized variable is not used. This might fix #9345, although I am not sure how. References #9345. diff -r 57ea320e2727 -r 25db53cfc12c pidgin/gtknotify.c --- a/pidgin/gtknotify.c Fri Jun 26 23:59:34 2009 +0000 +++ b/pidgin/gtknotify.c Sat Jun 27 05:45:43 2009 +0000 @@ -557,7 +557,10 @@ gtk_tree_store_remove(treemodel, &iter); advanced = (iter.stamp == 0) ? FALSE : TRUE; #endif - purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + if (data->purple_has_handle) + purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + else + pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); /* We're completely done if we've processed all entries */ if (!advanced) return NULL; @@ -612,7 +615,7 @@ char *notification; PurpleAccount *account; PidginNotifyMailData *data = NULL, *data2; - gboolean new_data; + gboolean new_data = FALSE; /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ if (count == 0 && mail_dialog == NULL) @@ -660,7 +663,7 @@ /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE, &new_data); - if (new_data) { + if (data2 && new_data) { if (data) data->purple_has_handle = FALSE; data = data2; @@ -677,7 +680,7 @@ (int)count), *tos, (int)count); data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data); - if (new_data) { + if (data2 && new_data) { if (data) data->purple_has_handle = FALSE; data = data2;