aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-13 15:19:04 +0000
committerJason Woodward2005-01-13 15:19:04 +0000
commit2632ca2f1f075e7b91b34c249ca5041a7390ff43 (patch)
tree2fbe71741f23fd9fd74a5908f42f15d36dbb6b92 /src
parentff578c3587ed550c48d7fa8a581966d303768584 (diff)
downloadslapt-get-2632ca2f1f075e7b91b34c249ca5041a7390ff43.tar.gz
fixed bug where conflict of a dep might slip through and allow the requested package to successfully be installed
Diffstat (limited to 'src')
-rw-r--r--src/transaction.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/transaction.c b/src/transaction.c
index eaa3cc0..5e58d15 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -521,15 +521,27 @@ int add_deps_to_trans(const rc_config *global_config, transaction_t *tran, struc
if( (dep_installed = get_newest_pkg(installed_pkgs,deps->pkgs[c]->name)) == NULL ){
- if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL )
+ if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL ){
add_install_to_transaction(tran,deps->pkgs[c]);
+ }else{
+ /* free_pkg_list(deps); */
+ free(deps->pkgs);
+ free(deps);
+ return -1;
+ }
}else{
/* add only if its a valid upgrade */
if(cmp_pkg_versions(dep_installed->version,deps->pkgs[c]->version) < 0 ){
- if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL )
+ if ( is_conflicted(tran,avail_pkgs,installed_pkgs,deps->pkgs[c]) == NULL ){
add_upgrade_to_transaction(tran,dep_installed,deps->pkgs[c]);
+ }else{
+ /* free_pkg_list(deps); */
+ free(deps->pkgs);
+ free(deps);
+ return -1;
+ }
}
}