From 465cd424633100163cc79743e833a5f4bcd77890 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 9 May 2010 21:58:28 +0000 Subject: [PATCH] Memory leak: - getLocalInterfaces -> iptable = (MIB_IPADDRTABLE *) malloc(dwSize); - main -> RshareSettings *_settings = new RshareSettings(); ExtAddrFinder::~ExtAddrFinder - use free for pointer allocated with malloc git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2882 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/pqinetwork.cc | 2 ++ libretroshare/src/tcponudp/extaddrfinder.cc | 2 +- retroshare-gui/src/main.cpp | 12 +++++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/pqi/pqinetwork.cc b/libretroshare/src/pqi/pqinetwork.cc index e2f9a7207..f83c1e1ca 100644 --- a/libretroshare/src/pqi/pqinetwork.cc +++ b/libretroshare/src/pqi/pqinetwork.cc @@ -352,6 +352,8 @@ std::list getLocalInterfaces() addrs.push_back(inet_ntoa(addr)); } + free (iptable); + return addrs; } diff --git a/libretroshare/src/tcponudp/extaddrfinder.cc b/libretroshare/src/tcponudp/extaddrfinder.cc index a2146cd55..d1b9d2502 100644 --- a/libretroshare/src/tcponudp/extaddrfinder.cc +++ b/libretroshare/src/tcponudp/extaddrfinder.cc @@ -267,7 +267,7 @@ ExtAddrFinder::~ExtAddrFinder() delete _found ; delete _searching ; - delete _addr ; + free (_addr) ; } ExtAddrFinder::ExtAddrFinder() diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index f47ec0a65..1ff00e231 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -161,13 +161,15 @@ int main(int argc, char *argv[]) QObject::connect(w->messengerWindow,SIGNAL(startChat(QTreeWidgetItem* )),w->peersDialog,SLOT(chatfriend(QTreeWidgetItem* ))) ; QObject::connect(w->idle, SIGNAL(secondsIdle(int)), w->messengerWindow, SLOT(checkAndSetIdle(int))); - /* only show window, if not startMinimized */ - RshareSettings *_settings = new RshareSettings(); - - if(!_settings->value(QString::fromUtf8("StartMinimized"), false).toBool()) { + /* only show window, if not startMinimized */ + RshareSettings _settings; - w->show(); + if(!_settings.value(QString::fromUtf8("StartMinimized"), false).toBool()) + { + + w->show(); + } } /* Startup a Timer to keep the gui's updated */