8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 250decd commit 0c392edCopy full SHA for 0c392ed
src/HTTPURLEncodedBodyParser.cpp
@@ -46,11 +46,14 @@ HTTPURLEncodedBodyParser::HTTPURLEncodedBodyParser(HTTPRequest * req):
46
size_t bufferAvailable = CHUNKSIZE;
47
while(!_request->requestComplete()) {
48
if (bufferAvailable < MINCHUNKSIZE) {
49
- bodyBuffer = (char *)realloc(bodyBuffer, bufferUsed + CHUNKSIZE+1);
50
- if (bodyBuffer == NULL) {
+ char *pBuf = (char *)realloc(bodyBuffer, bufferUsed + CHUNKSIZE+1);
+ if (pBuf == NULL) {
51
HTTPS_LOGE("HTTPURLEncodedBodyParser: out of memory");
52
+ free(bodyBuffer);
53
+ bodyBuffer = NULL;
54
return;
55
}
56
+ bodyBuffer = pBuf;
57
bufferAvailable = CHUNKSIZE;
58
59
size_t didRead = _request->readChars(bodyBuffer+bufferUsed, bufferAvailable);
0 commit comments