[pacman-dev] [PATCH] pacman: correctly free lists

Allan McRae allan at archlinux.org
Thu Jun 20 06:59:54 UTC 2019


On 14/6/19 11:50 am, morganamilo wrote:
> 
> diff --git a/src/pacman/database.c b/src/pacman/database.c
> index f3b890ce..7a792bad 100644
> --- a/src/pacman/database.c
> +++ b/src/pacman/database.c
> @@ -105,7 +105,8 @@ static int check_db_missing_deps(alpm_list_t *pkglist)
>  		free(depstring);
>  		ret++;
>  	}
> -	FREELIST(data);
> +	alpm_list_free_inner(data, (alpm_list_fn_free)alpm_depmissing_free);
> +	alpm_list_free(data);
>  	return ret;
>  }
>  
> @@ -159,7 +160,8 @@ static int check_db_local_package_conflicts(alpm_list_t *pkglist)
>  				conflict->package1, conflict->package2);
>  		ret++;
>  	}
> -	FREELIST(data);
> +	alpm_list_free_inner(data, (alpm_list_fn_free)alpm_conflict_free);
> +	alpm_list_free(data);
>  	return ret;
>  }
>  
Thanks.

We must never trigger these code paths in our testsuite as running the
testsuite under valgrind did not find them.

A


More information about the pacman-dev mailing list