[pacman-dev] [PATCH 1/5] Two memleak fixes in pacman.
Dan McGee
dpmcgee at gmail.com
Sat Nov 17 10:37:49 EST 2007
On Nov 17, 2007 7:50 AM, Nagy Gabor <shiningxc at gmail.com> wrote:
> Both memleak was an unfreed alpm_db_whatprovides list.
>
> Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu>
> ---
> src/pacman/deptest.c | 1 +
> src/pacman/sync.c | 1 +
> 2 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/src/pacman/deptest.c b/src/pacman/deptest.c
> index 301558e..d17c821 100644
> --- a/src/pacman/deptest.c
> +++ b/src/pacman/deptest.c
> @@ -70,6 +70,7 @@ int pacman_deptest(alpm_list_t *targets)
> break;
> }
> }
> + alpm_list_free(provides);
> }
>
> if(!found) {
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index 5f1072f..6f3c5d5 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -532,6 +532,7 @@ int sync_trans(alpm_list_t *targets, int sync_only)
> if(prov) {
> pmpkg_t *pkg = alpm_list_getdata(prov);
> pname = alpm_pkg_get_name(pkg);
> + alpm_list_free(prov);
> break;
> }
> }
> --
> 1.5.3.5
Obviously I'll apply this. However, from a design standpoint, I really
wish we never had to call alpm_list_free() from the frontend on
anything returned by the library. When we start having to do that, it
leads to double frees and all sorts of other fun stuff.
-Dan
More information about the pacman-dev
mailing list