Fix memory leak on error path in register_select

And remove dead error handling code from unregister_select.

Closes https://github.com/espressif/esp-idf/pull/7296
This commit is contained in:
Aditya Patwardhan
2021-07-26 14:37:36 +08:00
committed by Zim Kalinowski
parent c128769170
commit 269d40c0db
3 changed files with 8 additions and 8 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

@@ -162,8 +162,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;
}