wxInputStream *wxHTTP::GetInputStream(const wxString& path)
{
- wxHTTPStream *inp_stream = new wxHTTPStream(this);
+ wxHTTPStream *inp_stream;
+
wxString new_path;
m_perr = wxPROTO_CONNERR;
if (!BuildRequest(path, wxHTTP_GET))
return NULL;
+ inp_stream = new wxHTTPStream(this);
+
if (!GetHeader(wxT("Content-Length")).IsEmpty())
inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(wxT("Content-Length")));
else