mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-22 02:35:25 +00: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
|
@ -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…
Reference in a new issue