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

src/mailers.c

index b65bfeb6a5db2f99a76174723795022d70a92731..e614cf0fc33fa7dfe017800b90575f42e96dd534 100644 (file)
@@ -184,9 +184,8 @@ static int enqueue_one_email_alert(struct proxy *p, struct server *s,
        LIST_INIT(&alert->rules.preset_vars); /* unused for email alerts */
        alert->srv = s;
 
-       if ((tcpcheck = pool_alloc(pool_head_tcpcheck_rule)) == NULL)
+       if ((tcpcheck = pool_zalloc(pool_head_tcpcheck_rule)) == NULL)
                goto error;
-       memset(tcpcheck, 0, sizeof(*tcpcheck));
        tcpcheck->action       = TCPCHK_ACT_CONNECT;
        tcpcheck->comment      = NULL;