]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: check if p is NULL in free_proxy()
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 20 Aug 2021 08:16:37 +0000 (10:16 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 20 Aug 2021 08:20:56 +0000 (10:20 +0200)
Check if p is NULL before trying to do anything  in free_proxy(),
like most free()-like function do.

src/proxy.c

index 237f297d75e49a548589e872fa499a06118b9496..87999ad5d3b9bdc62e09d452f12fe90761406259 100644 (file)
@@ -144,6 +144,9 @@ void free_proxy(struct proxy *p)
        struct proxy_deinit_fct *pxdf;
        struct server_deinit_fct *srvdf;
 
+       if (!p)
+               return;
+
        free(p->conf.file);
        free(p->id);
        free(p->cookie_name);