diff options
author | Thomas Haller <thaller@redhat.com> | 2020-03-03 09:50:43 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-03-03 09:53:17 +0100 |
commit | 0549351111ccfde9d6a404952c43234612028d13 (patch) | |
tree | c70d8907f3233e18c7493be4811c2c0d46795931 | |
parent | 843d696e46d96eb30642d872ba6c1a46c900ca14 (diff) | |
download | NetworkManager-0549351111ccfde9d6a404952c43234612028d13.tar.gz |
dhcp: clean source on dispatch failure (fix leak)
The GSource must also be unrefed. Also, first clear the field
before invoking callbacks to the upper layers.
Fixes: 843d696e46d9 ('dhcp: clean source on dispatch failure')
-rw-r--r-- | src/dhcp/nm-dhcp-nettools.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c index dfa51ec73e..00b416da3a 100644 --- a/src/dhcp/nm-dhcp-nettools.c +++ b/src/dhcp/nm-dhcp-nettools.c @@ -1072,8 +1072,8 @@ dhcp4_event_cb (int fd, * a predefined number of times (possibly infinite). */ _LOGE ("error %d dispatching events", r); + nm_clear_g_source_inst (&priv->event_source); nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL); - priv->event_source = NULL; return G_SOURCE_REMOVE; } |