From aad9397ef87d277c12c4031f4f912665cad6d722 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Feb 2018 23:37:19 +0100 Subject: [PATCH] fixed memory leak in p3GxsTunnel --- libretroshare/src/gxstunnel/p3gxstunnel.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretroshare/src/gxstunnel/p3gxstunnel.cc b/libretroshare/src/gxstunnel/p3gxstunnel.cc index 62e026393..eef365230 100644 --- a/libretroshare/src/gxstunnel/p3gxstunnel.cc +++ b/libretroshare/src/gxstunnel/p3gxstunnel.cc @@ -143,7 +143,10 @@ void p3GxsTunnelService::flush() for(std::list::iterator it=pendingDHItems.begin();it!=pendingDHItems.end();) if(locked_sendClearTunnelData(*it) ) + { + delete *it ; it = pendingDHItems.erase(it) ; + } else ++it ; } @@ -155,7 +158,10 @@ void p3GxsTunnelService::flush() for(std::list::iterator it=pendingGxsTunnelItems.begin();it!=pendingGxsTunnelItems.end();) if(locked_sendEncryptedTunnelData(*it) ) + { + delete *it ; it = pendingGxsTunnelItems.erase(it) ; + } else { ++it ; @@ -744,6 +750,8 @@ void p3GxsTunnelService::receiveTurtleData(RsTurtleGenericTunnelItem *gitem,cons } else std::cerr << "(EE) Deserialiased item has unexpected type." << std::endl; + + delete citem ; } }