From 85ecf73037f74bc798429a1a989e9a2ac6227ca7 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 11 Apr 2017 19:41:00 +0200 Subject: Remove a potential race condition in database code. --- src/database.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/database.c b/src/database.c index 886c9a4..b3ffb7f 100644 --- a/src/database.c +++ b/src/database.c @@ -83,8 +83,10 @@ void db_destroy(void) for (entry = database[i]; entry; entry = next) { next = entry->ht_chain.next; + pthread_mutex_lock(&entry->mutex); free(entry->revdns.data); free(entry->whois.data); + pthread_mutex_unlock(&entry->mutex); destroy_entry(entry); } -- cgit