]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] we could segfault during exit while freeing uri_auths
authorWilly Tarreau <w@1wt.eu>
Tue, 24 Jun 2008 09:14:45 +0000 (11:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 24 Jun 2008 09:14:45 +0000 (11:14 +0200)
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.

src/haproxy.c

index 330ef2a4d8be14831aae924f399d6fa04f286fa8..4ecf4c03f2b9f4cf4a112263170ace4f1d5f2bc2 100644 (file)
@@ -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;