gnome-system-tools r4097 - trunk/src/network



Author: carlosg
Date: Sat Jan 12 18:32:54 2008
New Revision: 4097
URL: http://svn.gnome.org/viewvc/gnome-system-tools?rev=4097&view=rev

Log:
2008-01-12  Carlos Garnacho  <carlosg gnome org>

        * network-locations.c (get_ethernet_iface_by_name) (set_interface):
        prevent a crash if the property didn't exist previously in the config
        file.


Modified:
   trunk/src/network/ChangeLog
   trunk/src/network/network-locations.c

Modified: trunk/src/network/network-locations.c
==============================================================================
--- trunk/src/network/network-locations.c	(original)
+++ trunk/src/network/network-locations.c	Sat Jan 12 18:32:54 2008
@@ -723,7 +723,7 @@
     {
       iface = OOBS_IFACE (oobs_list_get (list, &iter));
 
-      if (strcmp (name, oobs_iface_get_device_name (iface)) == 0)
+      if (compare_string (name, oobs_iface_get_device_name (iface)))
 	return iface;
 
       g_object_unref (iface);
@@ -779,9 +779,13 @@
 
 	  value = g_key_file_get_string (key_file, name, prop->key, NULL);
 	  ethernet = get_ethernet_iface_by_name (value);
-	  g_object_set (iface, prop->key, ethernet, NULL);
 
-	  g_object_unref (ethernet);
+	  if (ethernet)
+	    {
+	      g_object_set (iface, prop->key, ethernet, NULL);
+	      g_object_unref (ethernet);
+	    }
+
 	  g_free (value);
 	}
     }



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