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

src/filters.c

index 026d1c93af6df6e72484ccac7fbe556bb3ea6a53..859092be5a80043fde487dc47f4f6cfa422625d1 100644 (file)
@@ -398,10 +398,9 @@ flt_stream_add_filter(struct stream *s, struct flt_conf *fconf, unsigned int fla
        if (IS_HTX_STRM(s) && !(fconf->flags & FLT_CFG_FL_HTX))
                return 0;
 
-       f = pool_alloc(pool_head_filter);
+       f = pool_zalloc(pool_head_filter);
        if (!f) /* not enough memory */
                return -1;
-       memset(f, 0, sizeof(*f));
        f->config = fconf;
        f->flags |= flags;