diff --git a/components/esp_http_client/lib/http_utils.c b/components/esp_http_client/lib/http_utils.c index e78f09edc36..c2b6409629e 100644 --- a/components/esp_http_client/lib/http_utils.c +++ b/components/esp_http_client/lib/http_utils.c @@ -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 {