From 989214e2bb2f979daea8460907722753c9e07e9b Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Wed, 14 Aug 2024 19:39:03 +0200 Subject: [PATCH] filter_aws: fixed group metadata fetch issue and addressed (CID 507941) Signed-off-by: Leonardo Alminana --- plugins/filter_aws/aws.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/filter_aws/aws.c b/plugins/filter_aws/aws.c index afe94a8a466..c117ffe16ba 100644 --- a/plugins/filter_aws/aws.c +++ b/plugins/filter_aws/aws.c @@ -349,7 +349,7 @@ static int get_ec2_tag_keys(struct flb_filter_aws *ctx) flb_sds_destroy(tags_list); return -1; } - ctx->tag_keys_len = flb_calloc(ctx->tags_count, sizeof(size_t*)); + ctx->tag_keys_len = flb_calloc(ctx->tags_count, sizeof(size_t)); if (!ctx->tag_keys_len) { flb_errno(); flb_sds_destroy(tags_list); @@ -804,7 +804,8 @@ static int ec2_metadata_group_should_fetch(struct flb_filter_aws *ctx, interval = now - group->last_fetch_attempt; - if (interval < required_interval) { + if (group->last_fetch_attempt > 0 && + interval < required_interval) { return FLB_FALSE; } return FLB_TRUE;