mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Be consistent with memory treatment for plural option setters
In all cases we should duplicate the passed-in list so the caller is free to do with it as it pleases. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
991b3ff7e6
commit
c1a5b11f11
@ -402,7 +402,7 @@ int SYMEXPORT alpm_option_set_cachedirs(alpm_list_t *cachedirs)
|
||||
{
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle->cachedirs) FREELIST(handle->cachedirs);
|
||||
handle->cachedirs = cachedirs;
|
||||
handle->cachedirs = alpm_list_strdup(cachedirs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -488,7 +488,7 @@ int SYMEXPORT alpm_option_set_noupgrades(alpm_list_t *noupgrade)
|
||||
{
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle->noupgrade) FREELIST(handle->noupgrade);
|
||||
handle->noupgrade = noupgrade;
|
||||
handle->noupgrade = alpm_list_strdup(noupgrade);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ int SYMEXPORT alpm_option_set_noextracts(alpm_list_t *noextract)
|
||||
{
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle->noextract) FREELIST(handle->noextract);
|
||||
handle->noextract = noextract;
|
||||
handle->noextract = alpm_list_strdup(noextract);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -542,7 +542,7 @@ int SYMEXPORT alpm_option_set_ignorepkgs(alpm_list_t *ignorepkgs)
|
||||
{
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle->ignorepkg) FREELIST(handle->ignorepkg);
|
||||
handle->ignorepkg = ignorepkgs;
|
||||
handle->ignorepkg = alpm_list_strdup(ignorepkgs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ int SYMEXPORT alpm_option_set_ignoregrps(alpm_list_t *ignoregrps)
|
||||
{
|
||||
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
|
||||
if(handle->ignoregrp) FREELIST(handle->ignoregrp);
|
||||
handle->ignoregrp = ignoregrps;
|
||||
handle->ignoregrp = alpm_list_strdup(ignoregrps);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user