mbed-http
Fork of mbed-http by
Diff: source/http_response.h
- Revision:
- 18:f7a85895a941
- Parent:
- 15:ffc77f212382
--- a/source/http_response.h Mon Jul 31 15:36:33 2017 +0200
+++ b/source/http_response.h Mon Sep 04 16:31:38 2017 +0100
@@ -142,7 +142,13 @@
body = (char*)malloc(length);
}
else {
+ char* original_body = body;
body = (char*)realloc(body, body_offset + length);
+ if (body == NULL) {
+ printf("[HttpResponse] realloc for %d bytes failed\n", body_offset + length);
+ free(original_body);
+ return;
+ }
}
}
