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

src/server.c

index f1e294a836bacf3ffcddc728c62cf00041947866..7cec4ce47312e6f7adaaf1d468a1ec88408274ea 100644 (file)
@@ -2216,6 +2216,9 @@ static uint srv_release_dynsrv(struct server *srv)
  */
 void free_server(struct server *srv)
 {
+       if (!srv)
+               return;
+
        /* For dynamic servers, decrement the reference counter. Only free the
         * server when reaching zero.
         */