From 177a16a8d1b2f146bf1208482fed72c783aa23d6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 15 Oct 2007 20:04:22 +0200 Subject: [PATCH] [BUG] fix segfault on exit in new appsession code The new appsession code didn't like it when appsession_hash_destroy() was called with an empty hash table. Simply add the check. --- src/sessionhash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sessionhash.c b/src/sessionhash.c index dc328205a..eb5c213d4 100644 --- a/src/sessionhash.c +++ b/src/sessionhash.c @@ -92,6 +92,9 @@ void appsession_hash_destroy(struct appsession_hash *hash) unsigned int i; appsess *item; + if (!hash->table) + return; + for (i = 0; i < TABLESIZE; i++) { while (!LIST_ISEMPTY(&hash->table[i])) { item = LIST_ELEM(hash->table[i].n, appsess *, -- 2.47.3