summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2013-10-08 22:22:00 +0200
committerThomas Haller <thaller@redhat.com>2013-10-08 22:33:19 +0200
commit2b25d0d3e0ed2d73325d2e76fd0be4f0c93c8f6c (patch)
treea82cfa4efdcd83cb7ae34b886ee8a2c3c95acf66
parente9a362ba654ad286e4004e0d8736340272c7edf2 (diff)
downloadNetworkManager-2b25d0d3e0ed2d73325d2e76fd0be4f0c93c8f6c.tar.gz
core: avoid use-after-free in libnm-util/bond.verify()
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--libnm-util/nm-setting-bond.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c
index f3dc0f8640..000e0ee215 100644
--- a/libnm-util/nm-setting-bond.c
+++ b/libnm-util/nm-setting-bond.c
@@ -540,25 +540,25 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
addrs = g_strsplit (arp_ip_target, ",", -1);
if (!addrs[0]) {
- g_strfreev (addrs);
g_set_error (error,
NM_SETTING_BOND_ERROR,
NM_SETTING_BOND_ERROR_INVALID_OPTION,
_("'%s' option is empty"),
NM_SETTING_BOND_OPTION_ARP_IP_TARGET);
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
+ g_strfreev (addrs);
return FALSE;
}
for (i = 0; addrs[i]; i++) {
if (!inet_pton (AF_INET, addrs[i], &addr)) {
- g_strfreev (addrs);
g_set_error (error,
NM_SETTING_BOND_ERROR,
NM_SETTING_BOND_ERROR_INVALID_OPTION,
_("'%s' is not a valid IPv4 address for '%s' option"),
NM_SETTING_BOND_OPTION_ARP_IP_TARGET, addrs[i]);
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
+ g_strfreev (addrs);
return FALSE;
}
}