From 9e2241a940e413992ff40b148cdaee2457e31ea2 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 21 Jul 2017 23:15:50 +0200 Subject: [PATCH] attempt to fix memory leak in RsGenExchange. To be tested. --- libretroshare/src/gxs/rsgenexchange.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index fe5bd8707..da18917ca 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -3037,10 +3037,9 @@ void RsGenExchange::processRecvdMessages() NxsMsgPendingVect::iterator vit = std::find(mMsgPendingValidate.begin(), mMsgPendingValidate.end(), id); if(vit == mMsgPendingValidate.end()) - { - GxsPendingItem item(msg, id,time(NULL)); - mMsgPendingValidate.push_back(item); - } + mMsgPendingValidate.push_back(GxsPendingItem(msg, id,time(NULL))); + else + delete msg ; } }