Skip to content

Commit

Permalink
Fix memory leak in protocol 38 set_sky
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 5, 2020
1 parent db95ff2 commit 9ca0b37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/network/clientpackethandler.cpp
Expand Up @@ -1244,12 +1244,11 @@ void Client::handleCommand_HudSetSky(NetworkPacket* pkt)
skybox.bgcolor = video::SColor(readARGB8(is));
skybox.type = std::string(deSerializeString(is));
u16 count = readU16(is);
std::vector<std::string>* params = new std::vector<std::string>;

for (size_t i = 0; i < count; i++)
skybox.textures.emplace_back(deSerializeString(is));

bool clouds = true;
skybox.clouds = true;
try {
skybox.clouds = readU8(is);
} catch (...) {}
Expand Down

0 comments on commit 9ca0b37

Please sign in to comment.