Skip to content

Commit

Permalink
filter_aws: fixed group metadata fetch issue and addressed (CID 507941)
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <leonardo.alminana@chronosphere.io>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Aug 15, 2024
1 parent 17379db commit bb067d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/filter_aws/aws.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bb067d3

Please sign in to comment.