From 6f03fa6601e0f86a58ec555429cf3056c4f5363e Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 13 May 2016 17:58:38 +0200 Subject: [PATCH] Free TcpPacket pointer if returns because peer is unknown. --- libretroshare/src/tcponudp/tcpstream.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/tcponudp/tcpstream.cc b/libretroshare/src/tcponudp/tcpstream.cc index b4375b994..6e2f3b01b 100644 --- a/libretroshare/src/tcponudp/tcpstream.cc +++ b/libretroshare/src/tcponudp/tcpstream.cc @@ -1880,7 +1880,8 @@ int TcpStream::toSend(TcpPacket *pkt, bool retrans) std::cerr << "TcpStream::toSend() peerUnknown ERROR!!!"; std::cerr << std::endl; #endif - return 0; + delete pkt; + return 0; } /* get accurate timestamp */