summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-11-09 18:06:53 +0100
committerThomas Haller <thaller@redhat.com>2016-11-09 18:16:48 +0100
commit0759f7fbdb10cd326cc0606c5f5e847583d96d5d (patch)
treefb23a0911c907bb34a5b748a823152f24763ca86 /src
parent6c59784a59fac868e3867b3b505f15440b77d2c6 (diff)
downloadNetworkManager-0759f7fbdb10cd326cc0606c5f5e847583d96d5d.tar.gz
policy: fix memleak in clear_ip6_prefix_delegation()
Diffstat (limited to 'src')
-rw-r--r--src/nm-policy.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index d757800a5f..f9cd578444 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -150,13 +150,12 @@ _clear_ip6_subnet (gpointer key, gpointer value, gpointer user_data)
NMDevice *device = nm_manager_get_device_by_ifindex (nm_manager_get (),
GPOINTER_TO_INT (key));
- if (!device)
- return;
-
- /* We can not remove a subnet we already started announcing.
- * Just un-prefer it. */
- subnet->preferred = 0;
- nm_device_use_ip6_subnet (device, subnet);
+ if (device) {
+ /* We can not remove a subnet we already started announcing.
+ * Just un-prefer it. */
+ subnet->preferred = 0;
+ nm_device_use_ip6_subnet (device, subnet);
+ }
g_slice_free (NMPlatformIP6Address, subnet);
}