From: Tim Duesterhus Date: Sat, 6 Mar 2021 19:06:48 +0000 (+0100) Subject: CLEANUP: connection: Remove useless test for NULL before calling `pool_free()` X-Git-Tag: v2.4-dev12~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e004c2beae218d14eea841c2117868d4fcce145a;p=thirdparty%2Fhaproxy.git CLEANUP: connection: Remove useless test for NULL before calling `pool_free()` `pool_free()` is a noop when the given pointer is NULL. No need to test. --- diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index e00e6f820a..58b0d0e7b0 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -553,18 +553,14 @@ static inline void conn_free(struct connection *conn) sockaddr_free(&conn->src); sockaddr_free(&conn->dst); - if (conn->proxy_authority != NULL) { - pool_free(pool_head_authority, conn->proxy_authority); - conn->proxy_authority = NULL; - } - if (isttest(conn->proxy_unique_id)) { - pool_free(pool_head_uniqueid, conn->proxy_unique_id.ptr); - conn->proxy_unique_id = IST_NULL; - } - if (conn->hash_node) { - pool_free(pool_head_conn_hash_node, conn->hash_node); - conn->hash_node = NULL; - } + pool_free(pool_head_authority, conn->proxy_authority); + conn->proxy_authority = NULL; + + pool_free(pool_head_uniqueid, conn->proxy_unique_id.ptr); + conn->proxy_unique_id = IST_NULL; + + pool_free(pool_head_conn_hash_node, conn->hash_node); + conn->hash_node = NULL; /* By convention we always place a NULL where the ctx points to if the * mux is null. It may have been used to store the connection as a