mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
sd-dhcp-client: prevent timer related memory leaks
This commit is contained in:
committed by
Tom Gundersen
parent
c0dda18697
commit
2333154a2b
@@ -392,6 +392,8 @@ static int client_timeout_resend(sd_event_source *s, uint64_t usec,
|
||||
|
||||
next_timeout += (random_u32() & 0x1fffff);
|
||||
|
||||
client->timeout_resend = sd_event_source_unref(client->timeout_resend);
|
||||
|
||||
r = sd_event_add_monotonic(client->event,
|
||||
&client->timeout_resend,
|
||||
next_timeout,
|
||||
@@ -477,6 +479,8 @@ static int client_initialize_events(sd_dhcp_client *client,
|
||||
if (r < 0)
|
||||
goto error;
|
||||
|
||||
client->timeout_resend = sd_event_source_unref(client->timeout_resend);
|
||||
|
||||
r = sd_event_add_monotonic(client->event,
|
||||
&client->timeout_resend,
|
||||
usec, 0,
|
||||
|
||||
Reference in New Issue
Block a user