[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Patch for a leak in pkgProblemResolver::ResolveByKeepInternal()



Hello all,

My friend Harald Sitter noticed that pkgProblemResolver::ResolveByKeepInternal() in apt-pkg/algorithms.cc was leaking ~5 MiB of memory on his system (see http://paste.kde.org/599138/) when it was called. From my estimation, the temporary package list used for dependency resolution that ResolveByKeepInternal is allocating is never being freed, making this indeed a leak.

I've developed a patch that deletes the temporary package list at both of the return points of the function. This patch can be found attached to this email. I've done basic testing such as making sure it compiles and making sure that ResolveByKeep() still works in simple cases.

Cheers,
Jonathan Thomas

Attachment: leakfix.diff
Description: Binary data


Reply to: