Fix memory leak on error path in http_header_set_format

This commit is contained in:
Alex Henrie 2021-07-20 13:52:53 -06:00 committed by Aditya Patwardhan
parent e634a00ef8
commit afd3fc6d16

View File

@ -162,8 +162,8 @@ int http_header_set_format(http_header_handle_t header, const char *key, const c
char *buf = NULL; char *buf = NULL;
va_start(argptr, format); va_start(argptr, format);
len = vasprintf(&buf, format, argptr); len = vasprintf(&buf, format, argptr);
HTTP_MEM_CHECK(TAG, buf, return 0);
va_end(argptr); va_end(argptr);
HTTP_MEM_CHECK(TAG, buf, return 0);
if (buf == NULL) { if (buf == NULL) {
return 0; return 0;
} }