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

src/ssl_sock.c

index 83b9d11422d7e7bd4875518d366efe112e421297..527ec8001aebc2c0433914f58d0e96d77de52152 100644 (file)
@@ -1788,12 +1788,10 @@ static void ssl_init_keylog(struct connection *conn, int write_p, int version,
        if (SSL_get_ex_data(ssl, ssl_keylog_index))
                return;
 
-       keylog = pool_alloc(pool_head_ssl_keylog);
+       keylog = pool_zalloc(pool_head_ssl_keylog);
        if (!keylog)
                return;
 
-       memset(keylog, 0, sizeof(*keylog));
-
        if (!SSL_set_ex_data(ssl, ssl_keylog_index, keylog)) {
                pool_free(pool_head_ssl_keylog, keylog);
                return;