diff --git a/src/aws/flb_aws_util.c b/src/aws/flb_aws_util.c index 91f156fb3f9..7b6aa9843cc 100644 --- a/src/aws/flb_aws_util.c +++ b/src/aws/flb_aws_util.c @@ -835,7 +835,7 @@ flb_sds_t flb_get_s3_key(const char *format, time_t time, const char *tag, char tmp = NULL; /* A string no longer than S3_KEY_SIZE is created to store the formatted timestamp. */ - key = flb_malloc(S3_KEY_SIZE * sizeof(char)); + key = flb_calloc(1, S3_KEY_SIZE * sizeof(char)); if (!key) { goto error; }