]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: don't dereference ->scope unless set
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Feb 2021 14:29:10 +0000 (15:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 23 Feb 2021 14:45:23 +0000 (15:45 +0100)
Coverity 1446388

src/resolve/resolved-dns-transaction.c

index e33701235139aff8afde14eedfd35b0e06b8d150..590652e5d35bbcac310cf85abbfb153770c08525 100644 (file)
@@ -121,10 +121,10 @@ DnsTransaction* dns_transaction_free(DnsTransaction *t) {
                 }
 
                 LIST_REMOVE(transactions_by_scope, t->scope->transactions, t);
-        }
 
-        if (t->id != 0)
-                hashmap_remove(t->scope->manager->dns_transactions, UINT_TO_PTR(t->id));
+                if (t->id != 0)
+                        hashmap_remove(t->scope->manager->dns_transactions, UINT_TO_PTR(t->id));
+        }
 
         while ((c = set_steal_first(t->notify_query_candidates)))
                 set_remove(c->transactions, t);