From: Willy Tarreau Date: Tue, 24 Jun 2008 09:14:45 +0000 (+0200) Subject: [BUG] we could segfault during exit while freeing uri_auths X-Git-Tag: v1.3.16-rc1~252 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=accc4e1e8678e588db6c2f98a52e788d8600cfaa;p=thirdparty%2Fhaproxy.git [BUG] we could segfault during exit while freeing uri_auths The following config makes haproxy segfault on exit : defaults mode http balance roundrobin listen no-stats bind :8001 listen stats bind :8002 stats uri /stats The simple fix is to ensure that p->uri_auth is not NULL before dereferencing it. --- diff --git a/src/haproxy.c b/src/haproxy.c index 330ef2a4d8..4ecf4c03f2 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -737,7 +737,7 @@ void deinit(void) if (uap == p->uri_auth) break; - if (!uap) { + if (!uap && p->uri_auth) { /* add it, if it is */ p->uri_auth->next = ua; ua = p->uri_auth;