FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-07-2009, 02:34 PM
Nagy Gabor
 
Default Free *data list when user removes unresolvable packages (RESUBMIT)

>From 9cfe60f495dfabe29d92e426f9c823fedd315ca6 Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Date: Sat, 7 Mar 2009 16:25:29 +0100
Subject: [PATCH] Free *data list when user removes unresolvable packages

Resolvedeps reports error when it cannot resolve some dependencies, puts
them into the *data list, and set pm_errno. If user removes the
unresolvable packages from the target list, we have no error anymore,
so from now on we free *data list (we eliminate a memleak) and unset
pm_errno.

(Additionally I removed two needless lines from the code, unresolvable list
is always freed in cleanup.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
---
lib/libalpm/sync.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 84a18e2..f100fb6 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -450,14 +450,16 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
NULL, NULL, &remove_unresolvable);
if (remove_unresolvable) {
/* User wants to remove the unresolvable packages from the
- transaction, so simply drop the unresolvable list. The
- packages will be removed from the actual transaction when
- the transaction packages are replaced with a
+ transaction. The packages will be removed from the actual
+ transaction when the transaction packages are replaced with a
dependency-reordered list below */
- alpm_list_free(unresolvable);
- unresolvable = NULL;
- }
- else {
+ pm_errno = 0; /* pm_errno was set by resolvedeps */
+ if(data) {
+ alpm_list_free_inner(*data, (alpm_list_fn_free)_alpm_depmiss_free);
+ alpm_list_free(*data);
+ *data = NULL;
+ }
+ } else {
/* pm_errno is set by resolvedeps */
ret = -1;
goto cleanup;
--
1.6.0.3



_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://www.archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 11:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org