Skip to content

Commit

Permalink
common: make sizeof the last argument for calloc
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Sep 5, 2024
1 parent 0ced6ad commit 4b8feed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ocispec/json_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4b8feed

Please # to comment.