summaryrefslogtreecommitdiff
path: root/system-settings/plugins/ifcfg-fedora/reader.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2008-11-17 18:39:20 +0000
committerDan Williams <dcbw@redhat.com>2008-11-17 18:39:20 +0000
commit43c782ac7d7d857de339a0d2f6dab4444c19ac7a (patch)
treec19566906dd0e23c4afd8de9cf194fd4b276192f /system-settings/plugins/ifcfg-fedora/reader.c
parent87452f1183ac2c644352f6500214491629ea1be9 (diff)
downloadNetworkManager-43c782ac7d7d857de339a0d2f6dab4444c19ac7a.tar.gz
2008-11-17 Dan Williams <dcbw@redhat.com>
* system-settings/plugins/ifcfg-fedora/reader.c - (read_mac_address): clean up - (make_wireless_setting): pass NULL array to read_mac_address() like it expects * system-settings/plugins/ifcfg-fedora/plugin.c - (read_one_connection): don't segfault on NULL errors git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4294 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'system-settings/plugins/ifcfg-fedora/reader.c')
-rw-r--r--system-settings/plugins/ifcfg-fedora/reader.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/system-settings/plugins/ifcfg-fedora/reader.c b/system-settings/plugins/ifcfg-fedora/reader.c
index 1cdf846080..9ef81b1ab2 100644
--- a/system-settings/plugins/ifcfg-fedora/reader.c
+++ b/system-settings/plugins/ifcfg-fedora/reader.c
@@ -386,24 +386,16 @@ read_mac_address (shvarFile *ifcfg, GByteArray **array, GError **error)
mac = ether_aton (value);
if (!mac) {
+ g_free (value);
g_set_error (error, ifcfg_plugin_error_quark (), 0,
"The MAC address '%s' was invalid.", value);
- goto error;
+ return FALSE;
}
g_free (value);
*array = g_byte_array_sized_new (ETH_ALEN);
g_byte_array_append (*array, (guint8 *) mac->ether_addr_octet, ETH_ALEN);
-
return TRUE;
-
-error:
- g_free (value);
- if (*array) {
- g_byte_array_free (*array, TRUE);
- *array = NULL;
- }
- return FALSE;
}
static gboolean
@@ -647,7 +639,7 @@ make_wireless_setting (shvarFile *ifcfg,
GError **error)
{
NMSettingWireless *s_wireless;
- GByteArray *array;
+ GByteArray *array = NULL;
char *value;
s_wireless = NM_SETTING_WIRELESS (nm_setting_wireless_new ());