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 1 commit
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: 4 additions & 3 deletions src/AsyncHTTPSRequest_Impl_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,8 @@ bool AsyncHTTPSRequest::_parseURL(const String& url)

if (_URL)
{
_URL->scheme = new char[8];
//HTTPS scheme is 8 chars + NULL
_URL->scheme = new char[9];

if (! (_URL->scheme) )
return false;
Expand Down Expand Up @@ -1277,8 +1278,8 @@ bool AsyncHTTPSRequest::_buildRequest()
_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