weather: fix possible memleak

This commit is contained in:
Jacek Jendrzej
2019-06-13 16:48:02 +02:00
parent 43326650af
commit edd43ef5e9

View File

@@ -110,7 +110,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;