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

Update for memleak in AsyncHTTPSRequest_Impl_Generic.h #13

Merged
merged 2 commits into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/AsyncHTTPSRequest_Impl_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ bool AsyncHTTPSRequest::_parseURL(const String& url)

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

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

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

_URL = nullptr;
header* hdr = _headers;
Expand Down