mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 15:00:10 +01:00
n-dhcp4: fix resource leaks
The function n_dhcp4_c_connection_send_request does not release or take ownership of its request argument. Because of that, setting it to NULL in the caller prevents the auto-cleanup of the variable to be executed, causing a resource leak. Fix it. Fixes:e23b3c9c3a('Squashed 'shared/n-dhcp4/' content from commit fb1d43449') Fixes:243cc433fb('n-dhcp4: add new client probe function to send RELEASE message') (cherry picked from commit9edfc0438c)
This commit is contained in:
parent
d19068c9e3
commit
a1e1dd2978
1 changed files with 0 additions and 3 deletions
|
|
@ -1140,8 +1140,6 @@ int n_dhcp4_client_probe_transition_decline(NDhcp4ClientProbe *probe, NDhcp4Inco
|
|||
r = n_dhcp4_c_connection_send_request(&probe->connection, request, ns_now);
|
||||
if (r)
|
||||
return r;
|
||||
else
|
||||
request = NULL; /* consumed */
|
||||
|
||||
n_dhcp4_client_lease_unlink(probe->current_lease);
|
||||
probe->current_lease = n_dhcp4_client_lease_unref(probe->current_lease);
|
||||
|
|
@ -1346,7 +1344,6 @@ int n_dhcp4_client_probe_release(NDhcp4ClientProbe *probe) {
|
|||
|
||||
probe->state = N_DHCP4_CLIENT_PROBE_STATE_INIT;
|
||||
n_dhcp4_client_lease_unlink(probe->current_lease);
|
||||
request_out = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue