From 2b25d0d3e0ed2d73325d2e76fd0be4f0c93c8f6c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 8 Oct 2013 22:22:00 +0200 Subject: core: avoid use-after-free in libnm-util/bond.verify() Signed-off-by: Thomas Haller --- libnm-util/nm-setting-bond.c | 4 ++-- 1 file 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; } } -- cgit v1.2.1