Skip to content

Commit

Permalink
Fix memory leak on error path in http_header_set_format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhenrie authored and AdityaHPatwardhan committed Jul 25, 2021
1 parent f1ba2b3 commit 5401610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/esp_http_client/lib/http_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ int http_header_set_format(http_header_handle_t header, const char *key, const c
char *buf = NULL;
va_start(argptr, format);
len = vasprintf(&buf, format, argptr);
HTTP_MEM_CHECK(TAG, buf, return 0);
va_end(argptr);
HTTP_MEM_CHECK(TAG, buf, return 0);
if (buf == NULL) {
return 0;
}
Expand Down

0 comments on commit 5401610

Please sign in to comment.