diff --git a/plugins/out_s3/s3.c b/plugins/out_s3/s3.c index b8fe80f0dd2..3b1edafbdab 100644 --- a/plugins/out_s3/s3.c +++ b/plugins/out_s3/s3.c @@ -247,6 +247,7 @@ struct flb_http_client *mock_s3_call(char *error_env_var, char *api) c->resp.data = flb_calloc(len + 1, sizeof(char)); if (!c->resp.data) { flb_errno(); + flb_free(c); return NULL; } memcpy(c->resp.data, resp, len);