From d9eaa0d3405728cf5ed77c1ac46bff37cbc1bb58 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 27 Nov 2012 10:01:12 +0100 Subject: [PATCH] host: don't destroy reference counter The reference counter should not be destroyed in HostClearMemory() as the host can be reused directly (without going through Init function). --- src/host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host.c b/src/host.c index 7cf18dcdf7..63b3ef3cfe 100644 --- a/src/host.c +++ b/src/host.c @@ -79,6 +79,7 @@ void HostFree(Host *h) { if (h != NULL) { HostClearMemory(h); + SC_ATOMIC_DESTROY(h->use_cnt); SCMutexDestroy(&h->m); SCFree(h); (void) SC_ATOMIC_SUB(host_memuse, sizeof(Host)); @@ -112,7 +113,6 @@ void HostClearMemory(Host *h) { SCFree(h->iprep); h->iprep = NULL; } - SC_ATOMIC_DESTROY(h->use_cnt); } #define HOST_DEFAULT_HASHSIZE 4096