diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-09 18:06:53 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-09 18:16:48 +0100 |
commit | 0759f7fbdb10cd326cc0606c5f5e847583d96d5d (patch) | |
tree | fb23a0911c907bb34a5b748a823152f24763ca86 /src | |
parent | 6c59784a59fac868e3867b3b505f15440b77d2c6 (diff) | |
download | NetworkManager-0759f7fbdb10cd326cc0606c5f5e847583d96d5d.tar.gz |
policy: fix memleak in clear_ip6_prefix_delegation()
Diffstat (limited to 'src')
-rw-r--r-- | src/nm-policy.c | 13 |
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); } |