Nice catch, thanks! I'm rather amazed I didn't find this before. On 7-May-07, at 3:26 PM, David Faure wrote: > 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/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; -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/