Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 80eb60d

Browse files
authored
Merge pull request #13 from roel80/main
Update for memleak in AsyncHTTPSRequest_Impl_Generic.h
2 parents 04a3237 + 8379b52 commit 80eb60d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/AsyncHTTPSRequest_Impl_Generic.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ bool AsyncHTTPSRequest::_parseURL(const String& url)
11031103

11041104
if (_URL)
11051105
{
1106-
_URL->scheme = new char[8];
1106+
_URL->scheme = new char[strlen(ASYNC_HTTPS_PREFIX) + 1];
11071107

11081108
if (! (_URL->scheme) )
11091109
return false;
@@ -1276,9 +1276,8 @@ bool AsyncHTTPSRequest::_buildRequest()
12761276
AHTTPS_LOGDEBUG(F("write HTTP/1.1"));
12771277
_request->write(" HTTP/1.1\r\n");
12781278

1279-
// KH, comment out or crash, why ??? To check for possible memory leak
1280-
//SAFE_DELETE(_URL)
1281-
//////
1279+
// RK, incorrect string allocation (bufferoverflow) fixed that was cousing the crash.
1280+
SAFE_DELETE(_URL)
12821281

12831282
_URL = nullptr;
12841283
header* hdr = _headers;

0 commit comments

Comments
 (0)