sd-resolve: keep floating query referenced while we access it
authorLennart Poettering <lennart@poettering.net>
Tue, 12 Aug 2014 17:28:32 +0000 (19:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 Aug 2014 17:28:32 +0000 (19:28 +0200)
src/libsystemd/sd-resolve/sd-resolve.c

index 10f8ed2..df63f1d 100644 (file)
@@ -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;
 }