summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-cache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-05-18 23:23:17 +0200
committerLennart Poettering <lennart@poettering.net>2015-05-18 23:23:17 +0200
commitcab5b05903096e1c9cf5575ccc73f89d15c8db69 (patch)
tree0900fc3bb29907617f784137ae91fb39948651ac /src/resolve/resolved-dns-cache.c
parent6b7d2e9ea4cdb4cfa1512d37548a1a967623d7f2 (diff)
resolved: fix crash when shutting down
Reported by Cristian Rodríguez http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
Diffstat (limited to 'src/resolve/resolved-dns-cache.c')
-rw-r--r--src/resolve/resolved-dns-cache.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 33ca4d1a45..be52891681 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -91,11 +91,8 @@ void dns_cache_flush(DnsCache *c) {
assert(hashmap_size(c->by_key) == 0);
assert(prioq_size(c->by_expiry) == 0);
- hashmap_free(c->by_key);
- c->by_key = NULL;
-
- prioq_free(c->by_expiry);
- c->by_expiry = NULL;
+ c->by_key = hashmap_free(c->by_key);
+ c->by_expiry = prioq_free(c->by_expiry);
}
static void dns_cache_remove(DnsCache *c, DnsResourceKey *key) {