Skip to content

Commit 1d36659

Browse files
PettitWesleyedsiper
authored andcommitted
signv4: always use calloc
Signed-off-by: Wesley Pettit <[email protected]>
1 parent e2cdf1b commit 1d36659

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/flb_signv4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static flb_sds_t url_params_format(char *params)
399399
return flb_sds_create("");
400400
}
401401

402-
arr = flb_malloc(sizeof(struct flb_kv *) * items);
402+
arr = flb_calloc(1, sizeof(struct flb_kv *) * items);
403403
if (!arr) {
404404
flb_errno();
405405
flb_kv_release(&list);
@@ -825,7 +825,7 @@ static flb_sds_t flb_signv4_canonical_request(struct flb_http_client *c,
825825
all_items = mk_list_size(&list_tmp);
826826
excluded_items = 0;
827827
size = (sizeof(struct flb_kv *) * (all_items));
828-
arr = flb_malloc(size);
828+
arr = flb_calloc(1, size);
829829
if (!arr) {
830830
flb_errno();
831831
flb_kv_release(&list_tmp);
@@ -1164,7 +1164,7 @@ flb_sds_t flb_signv4_do(struct flb_http_client *c, int normalize_uri,
11641164
return NULL;
11651165
}
11661166

1167-
gmt = flb_malloc(sizeof(struct tm));
1167+
gmt = flb_calloc(1, sizeof(struct tm));
11681168
if (!gmt) {
11691169
flb_errno();
11701170
flb_aws_credentials_destroy(creds);

0 commit comments

Comments
 (0)