/* delete[] mess */ Well there's your mem leak.

This commit is contained in:
MarcEricMartel
2023-12-08 04:55:00 -05:00
parent 7d46536acc
commit 34976ef7ec
4 changed files with 76 additions and 79 deletions

View File

@@ -129,7 +129,7 @@ namespace netprot {
Chat() {}
Chat(Chat* cha) : src_id(cha->src_id), dest_id(cha->dest_id), dest_team_id(cha->dest_team_id) {
strcpy(mess, 140, cha->mess); }
~Chat() {/* delete[] mess; */}
~Chat() { delete[] mess; }
};
struct ChunkMod {
@@ -193,8 +193,8 @@ namespace netprot {
template <class T> void sendPack(SOCKET sock, T* pack, Buffer* buf);
template <class T> void sendPackTo(SOCKET sock, T* pack, Buffer* buf, sockaddr_in* sockad);
std::vector<char*> recvPacks(SOCKET sock, Buffer* buf);
std::vector<char*> recvPacksFrom(SOCKET sock, Buffer* buf, sockaddr_in from);
void recvPacks(SOCKET sock, Buffer* buf, std::vector<char*>* lsPck);
void recvPacksFrom(SOCKET sock, Buffer* buf, sockaddr_in from, std::vector<char*>* lsPck);
/* Templates */