Suspected memory leak in WebRequest

 

Just wrote a small POC that is constantly leaking memory. Anyone sees any problems with the code or is it the terminal that is leaking?

const string method = "POST";
const string url = "http://localhost/mt5bridge";
const string headers = "content-Type: application/json\r\n";

int OnInit()
{
        EventSetMillisecondTimer(100);
        return (INIT_SUCCEEDED);
}

void OnDeinit(const int reason)
{
	EventKillTimer();
}

void OnTimer()
{	

char request[];

   string responseHeaders = NULL;    int request_len = StringToCharArray("[]", request, 0, WHOLE_ARRAY) - 1;    ArrayResize(request, request_len);    char response[];    int resp = WebRequest(                 method,                 url,                 headers,                 0,                 request,                 response,                 responseHeaders);                      ArrayFree(request);     ArrayFree(response); }
 

You could at least show what memory leaking you are talking about, as nobody can run your code as is except you.

Your code seems correct.

 
Alain Verleyen:

You could at least show what memory leaking you are talking about, as nobody can run your code as is except you.

Your code seems correct.

It's pretty simple. When you run this EA, terminal is eating up more and more memory until Windows force-closes it.. It's not my code that is leaking here, it looks like a terminal bug.

Reason: