weather: fix possible memleak

Origin commit data
------------------
Branch: ni/coolstream
Commit: eed4389741
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2019-06-14 (Fri, 14 Jun 2019)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2019-06-14 22:40:28 +02:00
committed by vanhofen
parent b3e83e64ed
commit 9a0aa76a48

View File

@@ -111,7 +111,10 @@ bool CWeather::GetWeatherDetails()
answer.clear(); answer.clear();
if (!getUrl(data, answer)) if (!getUrl(data, answer))
{
delete reader;
return false; return false;
}
bool parsedSuccess = reader->parse(answer.c_str(), answer.c_str() + answer.size(), &DataValues, &formattedErrors); bool parsedSuccess = reader->parse(answer.c_str(), answer.c_str() + answer.size(), &DataValues, &formattedErrors);
delete reader; delete reader;