mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(esp_http_client): return an error when append_string realloc fails
This commit is contained in:
@@ -69,7 +69,7 @@ char *http_utils_append_string(char **str, const char *new_str, int len)
|
||||
if (old_str) {
|
||||
old_len = strlen(old_str);
|
||||
old_str = realloc(old_str, old_len + l + 1);
|
||||
mem_check(old_str);
|
||||
ESP_RETURN_ON_FALSE(old_str, NULL, TAG, "Memory exhausted");
|
||||
// Ensure the new string is null-terminated
|
||||
old_str[old_len + l] = 0;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user