mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 12:40:16 +01:00
n-dhcp4: avoid double free of NDhcp4Outgoing
n_dhcp4_c_connection_start_request() should take ownership of the request only on success. On failure the request is freed by the caller. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/355
This commit is contained in:
parent
a119dac998
commit
43016d6ebd
1 changed files with 3 additions and 2 deletions
|
|
@ -1104,13 +1104,14 @@ int n_dhcp4_c_connection_start_request(NDhcp4CConnection *connection,
|
|||
if (request->userdata.start_time == 0)
|
||||
request->userdata.start_time = timestamp;
|
||||
|
||||
n_dhcp4_outgoing_free(connection->request);
|
||||
connection->request = request;
|
||||
connection->request = n_dhcp4_outgoing_free(connection->request);
|
||||
|
||||
r = n_dhcp4_c_connection_send_request(connection, request, timestamp);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
connection->request = request;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue