[pacman-dev] [PATCH] Fixed a memory leak when unresolved packages are removed from transaction
Nagy Gabor
ngaba at bibl.u-szeged.hu
Sat Mar 7 07:53:34 EST 2009
> +
> + /* Destroy all packages which are in trans->packages but not in
> + newpkgs before replacing trans->packages with newpkgs */
> + for(i = trans->packages; i; i = i->next) {
> + pmsyncpkg_t *spkg = (pmsyncpkg_t *) i->data;
> + for (j = newpkgs; j; j = j->next) {
> + if(_alpm_pkg_cmp(spkg->pkg, ((pmsyncpkg_t *) j->data)->pkg) == 0) {
> + spkg = NULL;
> + break;
> + }
> + }
> + if (spkg != NULL) {
> + _alpm_sync_free(spkg);
> + }
> + }
> +
Wow, this is ugly. But that is not your fault: I think this motivated me
to finally kill pmsyncpkg_t.
Bye
More information about the pacman-dev
mailing list