diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-11 00:31:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-11 00:31:19 +0300 |
commit | aebc6b4c1e047e8d864e961777b1d23a7c756b1a (patch) | |
tree | ebc0cce837b063e710ef0585604dceb7d21576a9 /src/net/ea | |
parent | 845f010511c88acd81da36d0e38b8ef12119d3e6 (diff) | |
download | manaverse-aebc6b4c1e047e8d864e961777b1d23a7c756b1a.tar.gz manaverse-aebc6b4c1e047e8d864e961777b1d23a7c756b1a.tar.bz2 manaverse-aebc6b4c1e047e8d864e961777b1d23a7c756b1a.tar.xz manaverse-aebc6b4c1e047e8d864e961777b1d23a7c756b1a.zip |
Fix memory leak in BeingRecv::processBeingMove3, if player not totally visible.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/beingrecv.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net/ea/beingrecv.cpp b/src/net/ea/beingrecv.cpp index fcb3871f8..bf7ae32ba 100644 --- a/src/net/ea/beingrecv.cpp +++ b/src/net/ea/beingrecv.cpp @@ -428,13 +428,15 @@ void BeingRecv::processBeingMove3(Net::MessageIn &msg) const int len = msg.readInt16("len") - 14; Being *const dstBeing = actorManager->findBeing( msg.readBeingId("being id")); - if ((dstBeing == nullptr) || dstBeing == localPlayer) + if (dstBeing == nullptr || + dstBeing == localPlayer) { DEBUGLOGSTR("invisible player?"); msg.readInt16("speed"); msg.readInt16("x"); msg.readInt16("y"); - msg.readBytes(len, "moving path"); + unsigned char *bytes = msg.readBytes(len, "moving path"); + delete [] bytes; BLOCK_END("BeingRecv::processBeingMove3") return; } |