Skip to content

Commit

Permalink
aws: utils: fix mem leak in flb_imds_request (#2532)
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
  • Loading branch information
PettitWesley authored and edsiper committed Sep 6, 2020
1 parent d503e11 commit 63b0577
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/aws/flb_aws_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ int flb_imds_request(struct flb_aws_client *client, char *metadata_path,

if (!ec2_metadata) {
flb_errno();
flb_http_client_destroy(c);
return -1;
}
*metadata = ec2_metadata;
Expand All @@ -452,9 +453,9 @@ int flb_imds_request(struct flb_aws_client *client, char *metadata_path,
flb_http_client_destroy(c);
return 0;
}
else {
flb_debug("[ecs_imds] IMDS metadata response was empty");
flb_http_client_destroy(c);
return -1;
}

flb_debug("[ecs_imds] IMDS metadata response was empty");
flb_http_client_destroy(c);
return -1;

}

0 comments on commit 63b0577

Please sign in to comment.