From kde-commits Mon May 07 22:26:50 2007 From: David Faure Date: Mon, 07 May 2007 22:26:50 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/kio Message-Id: <1178576810.075926.30987.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117857682732071 SVN commit 662342 by dfaure: getChain() returns a list of new'ed KSSLCertificates, so any caller of getChain() needs to make sure the items are deleted, otherwise we leak memory. Bug found while porting the code to kde4 :) CCMAIL: staikos@kde.org M +3 -3 kfile/kurlcombobox.h M +1 -0 kio/tcpslavebase.cpp M +1 -0 kssl/ksslinfodlg.cc --- branches/KDE/3.5/kdelibs/kio/kfile/kurlcombobox.h #662341:662342 @@ -16,8 +16,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef KDIRCOMBOBOX_H -#define KDIRCOMBOBOX_H +#ifndef KURLCOMBOBOX_H +#define KURLCOMBOBOX_H #include #include @@ -226,4 +226,4 @@ }; -#endif // KDIRCOMBOBOX_H +#endif // KURLCOMBOBOX_H --- branches/KDE/3.5/kdelibs/kio/kio/tcpslavebase.cpp #662341:662342 @@ -815,6 +815,7 @@ if (pc.chain().isValid() && pc.chain().depth() > 1) { QString theChain; QPtrList chain = pc.chain().getChain(); + chain.setAutoDelete(true); for (KSSLCertificate *c = chain.first(); c; c = chain.next()) { theChain += c->toString(); theChain += "\n"; --- branches/KDE/3.5/kdelibs/kio/kssl/ksslinfodlg.cc #662341:662342 @@ -193,6 +193,7 @@ d->_chain->insertItem(i18n("0 - Site Certificate")); int cnt = 0; QPtrList cl = cert->chain().getChain(); + cl.setAutoDelete(true); for (KSSLCertificate *c = cl.first(); c != 0; c = cl.next()) { KSSLX509Map map(c->getSubject()); QString id;