gresolv: Destroy query after removing it from the resolv queue
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 7 Dec 2010 11:16:57 +0000 (12:16 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 7 Dec 2010 11:16:57 +0000 (12:16 +0100)
Fixes BMC#10958

gweb/gresolv.c

index c99b690..b954785 100644 (file)
@@ -142,12 +142,12 @@ static void destroy_query(struct resolv_query *query)
 static void destroy_lookup(struct resolv_lookup *lookup)
 {
        if (lookup->ipv4_query) {
 static void destroy_lookup(struct resolv_lookup *lookup)
 {
        if (lookup->ipv4_query) {
-               destroy_query(lookup->ipv4_query);
                g_queue_remove(lookup->resolv->query_queue, lookup->ipv4_query);
                g_queue_remove(lookup->resolv->query_queue, lookup->ipv4_query);
+               destroy_query(lookup->ipv4_query);
        }
        if (lookup->ipv6_query) {
        }
        if (lookup->ipv6_query) {
-               destroy_query(lookup->ipv6_query);
                g_queue_remove(lookup->resolv->query_queue, lookup->ipv6_query);
                g_queue_remove(lookup->resolv->query_queue, lookup->ipv6_query);
+               destroy_query(lookup->ipv6_query);
        }
        g_free(lookup->results);
        g_free(lookup);
        }
        g_free(lookup->results);
        g_free(lookup);