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

src/resolvers.c

index c14b9706ad46a78fa667beb7cf83035c61abff52..b6b8982e31436fef7ac104a5e89c549600022634 100644 (file)
@@ -1660,9 +1660,8 @@ static struct resolv_resolution *resolv_pick_resolution(struct resolvers *resolv
 
   from_pool:
        /* No resolution could be found, so let's allocate a new one */
-       res = pool_alloc(resolv_resolution_pool);
+       res = pool_zalloc(resolv_resolution_pool);
        if (res) {
-               memset(res, 0, sizeof(*res));
                res->resolvers  = resolvers;
                res->uuid       = resolution_uuid;
                res->status     = RSLV_STATUS_NONE;