summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2014-02-20 21:04:03 +0100
committerTom Gundersen <teg@jklm.no>2014-02-20 22:12:25 +0100
commit2333154a2b81bcb9dbf034ad004d975561e8b79d (patch)
treee024c5c495049c35e509092c107c9f82aafc9db6 /src/libsystemd-dhcp
parentc0dda18697e0994272c0c9616d36f6777b60e2c7 (diff)
sd-dhcp-client: prevent timer related memory leaks
Diffstat (limited to 'src/libsystemd-dhcp')
-rw-r--r--src/libsystemd-dhcp/sd-dhcp-client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd-dhcp/sd-dhcp-client.c b/src/libsystemd-dhcp/sd-dhcp-client.c
index ec2b53ffe1..53abe22257 100644
--- a/src/libsystemd-dhcp/sd-dhcp-client.c
+++ b/src/libsystemd-dhcp/sd-dhcp-client.c
@@ -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,