Message ID | 20230927200143.3798124-6-thaller@redhat.com |
---|---|
State | Accepted |
Delegated to: | Pablo Neira |
Headers | show |
Series | more various cleanups related to struct datatype | expand |
On Wed, Sep 27, 2023 at 09:57:28PM +0200, Thomas Haller wrote: > The returned memory will be initialized. No need to zero it first. Use > xmalloc() instead of xzalloc(). Applied this little patch, thanks
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);
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> --- src/datatype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)