[PATCH nft 5/5] datatype: use xmalloc() for allocating datatype in datatype_clone()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The returned memory will be initialized. No need to zero it first. Use
xmalloc() instead of xzalloc().

Signed-off-by: Thomas Haller <thaller@xxxxxxxxxx>
---
 src/datatype.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/datatype.c b/src/datatype.c
index f9570603467a..eae7f4c71fbe 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -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;
 	if (orig_dtype->f_allocated_strings) {
 		dtype->name = xstrdup(orig_dtype->name);
-- 
2.41.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux