Commit 54d10f0e authored by Beniamino Galvani's avatar Beniamino Galvani

device: fix memory leak in act_stage3_ip6_config_start()

If linklocal6_start() finds that the device already has an IPv6
link-local address and returns NM_ACT_STAGE_RETURN_FINISH, we don't
need to fill @out_config with an empty configuration. A non-NULL
@out_config is required only for ret = NM_ACT_STAGE_RETURN_SUCCESS.

Fixes: 396dc2b3
parent c0138fa7
...@@ -5203,11 +5203,6 @@ act_stage3_ip6_config_start (NMDevice *self, ...@@ -5203,11 +5203,6 @@ act_stage3_ip6_config_start (NMDevice *self,
ret = NM_ACT_STAGE_RETURN_POSTPONE; ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) { } else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
ret = linklocal6_start (self); ret = linklocal6_start (self);
if (ret == NM_ACT_STAGE_RETURN_FINISH) {
/* New blank config; LL address is already in priv->ext_ip6_config */
*out_config = nm_ip6_config_new (nm_device_get_ip_ifindex (self));
g_assert (*out_config);
}
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) { } else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {
priv->dhcp6_mode = NM_RDISC_DHCP_LEVEL_MANAGED; priv->dhcp6_mode = NM_RDISC_DHCP_LEVEL_MANAGED;
if (!dhcp6_start (self, TRUE, reason)) { if (!dhcp6_start (self, TRUE, reason)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment