From d708370db422d1631db7c49bb267fe76aad04b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= Date: Tue, 28 Jan 2020 09:43:55 +0100 Subject: [PATCH] Fix atomics usage for mutexatomics --- lib/dns/resolver.c | 2 +- lib/isc/hp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c36a70c8a9..55273d8e17 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4832,7 +4832,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type, fctx->vresult = ISC_R_SUCCESS; fctx->exitline = -1; /* sentinel */ fctx->logged = false; - atomic_store(&fctx->attributes, 0); + atomic_init(&fctx->attributes, 0); fctx->spilled = false; fctx->nqueries = 0; fctx->reason = NULL; diff --git a/lib/isc/hp.c b/lib/isc/hp.c index b8bf8670a4..56b9e5484b 100644 --- a/lib/isc/hp.c +++ b/lib/isc/hp.c @@ -135,7 +135,7 @@ void isc_hp_destroy(isc_hp_t *hp) { for (int i = 0; i < isc__hp_max_threads; i++) { isc_mem_put(hp->mctx, hp->hp[i], - CLPAD * 2 * sizeof(uintptr_t)); + CLPAD * 2 * sizeof(hp->hp[i][0])); for (int j = 0; j < hp->rl[i]->size; j++) { void *data = (void *)hp->rl[i]->list[j];