]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] fix segfault on exit in new appsession code
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2007 18:04:22 +0000 (20:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2007 18:08:16 +0000 (20:08 +0200)
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

index dc328205aa2d3c8b2b3bb726026fc32d7e4ef749..eb5c213d437acd5eb273f85ef72b0aa3633091bc 100644 (file)
@@ -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 *,