summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-resolve
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-12 19:28:32 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-12 19:28:32 +0200
commit502fe44ea44fdbe2282fbe0625bb2e01777425c0 (patch)
treec0a57bf0c316e882b620b0cfa6ec37c324f77107 /src/libsystemd/sd-resolve
parent84e51726a38e133ca42d2f30f0668d3921b210cb (diff)
sd-resolve: keep floating query referenced while we access it
Diffstat (limited to 'src/libsystemd/sd-resolve')
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 10f8ed29a2..df63f1de9e 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -772,13 +772,15 @@ static int complete_query(sd_resolve *resolve, sd_resolve_query *q) {
assert_not_reached("Cannot complete unknown query type");
}
- resolve->current = sd_resolve_query_unref(q);
+ resolve->current = NULL;
if (q->floating) {
resolve_query_disconnect(q);
sd_resolve_query_unref(q);
}
+ sd_resolve_query_unref(q);
+
return r;
}