Merge branch 'fix/memory_leaks_identified_by_cppcheck_v3.3' into 'release/v3.3'

Fix/memory leaks identified by cppcheck (v3.3)

See merge request espressif/esp-idf!14505
This commit is contained in:
Mahavir Jain
2021-07-26 04:04:06 +00:00
2 changed files with 2 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ static int md5_printf(char *md, const char *fmt, ...)
va_start(ap, fmt);
len = vasprintf((char **)&buf, fmt, ap);
if (buf == NULL) {
va_end(ap);
return ESP_FAIL;
}

View File

@@ -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;
}