[gnome-bluetooth] applet: fix a crash in bluetooth_applet_create_device_from_iter



commit ed6fb4908c526caa9e4fca6918f5554949326473
Author: Dan Winship <danw gnome org>
Date:   Wed Nov 17 14:55:45 2010 -0500

    applet: fix a crash in bluetooth_applet_create_device_from_iter
    
    dev->device_path was not being initialized in some cases, causing a
    crash when it was freed later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=635104

 applet/bluetooth-applet.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/applet/bluetooth-applet.c b/applet/bluetooth-applet.c
index 1b5968a..bc8c23c 100644
--- a/applet/bluetooth-applet.c
+++ b/applet/bluetooth-applet.c
@@ -876,11 +876,13 @@ bluetooth_applet_create_device_from_iter (GtkTreeModel *model,
 					  GtkTreeIter  *iter,
 					  gboolean      check_proxy)
 {
-	BluetoothSimpleDevice* dev = g_new (BluetoothSimpleDevice, 1);
+	BluetoothSimpleDevice *dev;
 	GHashTable *services;
 	DBusGProxy *proxy;
 	char **uuids;
 
+	dev = g_new0 (BluetoothSimpleDevice, 1);
+
 	gtk_tree_model_get (model, iter,
 			    BLUETOOTH_COLUMN_ADDRESS, &dev->bdaddr,
 			    BLUETOOTH_COLUMN_PROXY, &proxy,



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