[gnome-bluetooth] wizard: fix memleaks



commit de9770274fc3ad9aa58a63100408f181f7674c30
Author: Daniele Forsi <dforsi src gnome org>
Date:   Mon Nov 21 21:58:55 2011 +0100

    wizard: fix memleaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664510

 wizard/main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index f53c428..c5ede2b 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -145,6 +145,7 @@ set_large_label (GtkLabel *label, const char *text)
 static void
 update_random_pincode (void)
 {
+	g_free (target_pincode);
 	target_pincode = g_strdup_printf ("%d", g_random_int_range (pow (10, PIN_NUM_DIGITS - 1),
 								    pow (10, PIN_NUM_DIGITS) - 1));
 	automatic_pincode = FALSE;
@@ -387,6 +388,8 @@ create_callback (BluetoothClient *_client,
 		g_warning ("Setting up '%s' failed: %s", target_name, error->message);
 
 		gtk_label_set_markup(GTK_LABEL(label_failure), text);
+		g_free (text);
+
 		return;
 	}
 



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