]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: use xmalloc() for allocating datatype in datatype_clone()
authorThomas Haller <thaller@redhat.com>
Thu, 28 Sep 2023 19:12:01 +0000 (21:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 28 Sep 2023 19:13:32 +0000 (21:13 +0200)
The returned memory will be initialized. No need to zero it first. Use
xmalloc() instead of xzalloc().

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/datatype.c

index 6fe46e899c4bdc322468845cec9c6cdb1afc9b41..64e4647a605f1331afdded81b35e0bfd0b85e0b8 100644 (file)
@@ -1242,7 +1242,7 @@ struct datatype *datatype_clone(const struct datatype *orig_dtype)
 {
        struct datatype *dtype;
 
-       dtype = xzalloc(sizeof(*dtype));
+       dtype = xmalloc(sizeof(*dtype));
        *dtype = *orig_dtype;
        dtype->name = xstrdup(orig_dtype->name);
        dtype->desc = xstrdup(orig_dtype->desc);