fix(esp_http_client): return an error when append_string realloc fails

This commit is contained in:
Ashish Sharma
2026-08-25 13:58:16 +08:00
parent 25f5e205cd
commit 2312716f8c

View File

@@ -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 {