From 4b8feed53dd3ada708d5fed139e3d4331d18adba Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 5 Sep 2024 23:17:22 +0200 Subject: [PATCH] common: make sizeof the last argument for calloc Signed-off-by: Giuseppe Scrivano --- src/ocispec/json_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocispec/json_common.c b/src/ocispec/json_common.c index a8d742a7..fb2b8829 100644 --- a/src/ocispec/json_common.c +++ b/src/ocispec/json_common.c @@ -1505,7 +1505,7 @@ make_json_map_string_string (yajl_val src, const struct parser_context *ctx, len = YAJL_GET_OBJECT_NO_CHECK (src)->len; - ret = calloc (sizeof (*ret), 1); + ret = calloc (1, sizeof (*ret)); if (ret == NULL) { *(err) = strdup ("error allocating memory"); @@ -1574,7 +1574,7 @@ clone_map_string_string (json_map_string_string *src) if (src == NULL) return NULL; - ret = calloc (sizeof (*ret), 1); + ret = calloc (1, sizeof (*ret)); if (ret == NULL) return NULL;