]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: use pool_zalloc() in conn_alloc_hash_node()
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 20:01:05 +0000 (21:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 22:17:24 +0000 (23:17 +0100)
This one used to alloc then zero the area, let's have the allocator do it.

include/haproxy/connection.h

index 7370263314c4a1cd124a6acd0c2e4973edb03ffd..4f03aef7077af0585435e6f0df55d8562fc2f02a 100644 (file)
@@ -376,12 +376,10 @@ static inline struct conn_hash_node *conn_alloc_hash_node(struct connection *con
 {
        struct conn_hash_node *hash_node = NULL;
 
-       hash_node = pool_alloc(pool_head_conn_hash_node);
+       hash_node = pool_zalloc(pool_head_conn_hash_node);
        if (unlikely(!hash_node))
                return NULL;
 
-       memset(&hash_node->node, 0, sizeof(hash_node->node));
-       hash_node->hash = 0;
        hash_node->conn = conn;
 
        return hash_node;