[anjal: 1/6] Fix leak in check_and_set_default_mail()



commit 0faa869373f8e0c7667e83c7834578eb71e28594
Author: Jonathon Jongsma <jonathon jongsma collabora co uk>
Date:   Mon Oct 5 11:52:08 2009 -0500

    Fix leak in check_and_set_default_mail()
    
    Unref the gconf client before the early return if anjal is already set as the
    default mailer
    
    https://bugzilla.gnome.org/show_bug.cgi?id=599793

 src/main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 740a5cf..32a4fe0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,6 +19,7 @@
  *		Srinivasa Ragavan <sragavan novell com>
  *
  * Copyright (C) 2009 Novell, Inc. (www.novell.com)
+ * Copyright (C) 2009 Intel Corporation (www.intel.com)
  *
  */
 
@@ -116,8 +117,10 @@ check_and_set_default_mail (void)
 	gchar *mailer;
 	printf("coming here\n");
 	mailer  = gconf_client_get_string(client, GCONF_KEY_MAILTO_COMMAND, NULL);
-	if (mailer && *mailer && (strcmp (mailer, ANJAL_MAILTO_COMMAND) == 0))
+	if (mailer && *mailer && (strcmp (mailer, ANJAL_MAILTO_COMMAND) == 0)) {
+		g_object_unref (client);
 		return; /* Anjal is the default mailer */
+	}
 	
 	gconf_client_set_bool(client, GCONF_KEY_MAILTO_ENABLED, TRUE, NULL);
 	gconf_client_set_string(client, GCONF_KEY_MAILTO_COMMAND, ANJAL_MAILTO_COMMAND, NULL);



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