summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-05 23:49:19 +0200
committerLennart Poettering <lennart@poettering.net>2014-05-05 23:49:19 +0200
commit73dec31974a315f4329fb302d8efe0e24b9da1d4 (patch)
tree0ac113c774fadd361332da92fcc27876d5730251 /src
parentcc567911ba790931743c18332b2476e8c4accf64 (diff)
sd-resolve: make sure we can destroy a query object from its own callback handler
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index cb8e34e368..3f699ce232 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -737,7 +737,7 @@ static int complete_query(sd_resolve *resolve, sd_resolve_query *q) {
q->done = true;
resolve->n_done ++;
- resolve->current = q;
+ resolve->current = sd_resolve_query_ref(q);
switch (q->type) {
@@ -758,7 +758,7 @@ static int complete_query(sd_resolve *resolve, sd_resolve_query *q) {
assert_not_reached("Cannot complete unknown query type");
}
- resolve->current = NULL;
+ resolve->current = sd_resolve_query_unref(q);
return r;
}