core: fix potential use-after-free resetting IPv6 accept_ra value

This commit is contained in:
Dan Williams
2010-06-30 13:37:34 -07:00
parent 4eea398b06
commit c38d1c28ff

View File

@@ -3332,13 +3332,6 @@ dispose (GObject *object)
addrconf6_cleanup (self);
dnsmasq_cleanup (self);
/* reset the saved RA value */
if (priv->ip6_accept_ra_path) {
nm_utils_do_sysctl (priv->ip6_accept_ra_path,
priv->ip6_accept_ra_save ? "1\n" : "0\n");
}
g_free (priv->ip6_accept_ra_path);
/* Take the device itself down and clear its IPv4 configuration */
if (priv->managed && take_down) {
NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE;
@@ -3347,6 +3340,13 @@ dispose (GObject *object)
nm_device_set_ip4_config (self, NULL, FALSE, &ignored);
}
/* reset the saved RA value */
if (priv->ip6_accept_ra_path) {
nm_utils_do_sysctl (priv->ip6_accept_ra_path,
priv->ip6_accept_ra_save ? "1\n" : "0\n");
}
g_free (priv->ip6_accept_ra_path);
activation_source_clear (self, TRUE, AF_INET);
activation_source_clear (self, TRUE, AF_INET6);