[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.
This commit is contained in:
Willy Tarreau 2007-10-15 20:04:22 +02:00
parent f223cc0b5c
commit 177a16a8d1

View File

@ -92,6 +92,9 @@ void appsession_hash_destroy(struct appsession_hash *hash)
unsigned int i; unsigned int i;
appsess *item; appsess *item;
if (!hash->table)
return;
for (i = 0; i < TABLESIZE; i++) { for (i = 0; i < TABLESIZE; i++) {
while (!LIST_ISEMPTY(&hash->table[i])) { while (!LIST_ISEMPTY(&hash->table[i])) {
item = LIST_ELEM(hash->table[i].n, appsess *, item = LIST_ELEM(hash->table[i].n, appsess *,