[Rpm-maint] rpmdbNextIterator: memory leakage?

Pazzo Da Legare pazzodalegare at gmail.com
Mon Dec 24 01:21:26 UTC 2007

Dear Panu,

Thank you for your email.
> Hmm.. I can't reproduce that signature related leak. What version of rpm
> is this?
I tried both and Then someone told me to use
rpmtsSetVSFlags(ts, -1) to disable certificate's check...and the
leakage disappear.


> A few general comments:
> - There's no need to explicitly open and close the rpmdb, it'll get lazily
>    opened when needed and closed in rpmtsFree().

> - You don't want to do generic rpm setup and open + closing of rpmdb in a
>    loop. rpmReadConfigFiles() only needs to be called once in a program
>    normally, and open+close of rpmdb isn't really a "free" operation so
>    avoid repeating it unnecessarily. Create a transaction set, do
>    everything you plan on doing on that single ts and then close it when
>    done.

So you say that I will need only something like:

one call at rpmReadConfigFiles() per program execution

and the for operations define and use a ts:

rpmts ts = rpmtsCreate();

....use ts

and finally



> BTW to fully clean up the rpm environment you'll need to call various
> cleanup functions: rpmFreeRpmrc(), rpmFreeMacros() and whatnot, but these
> only show up in "still reachable" leaks in valgrind.
>         - Panu -

More information about the Rpm-maint mailing list