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 04-10-2011, 11:25 AM
Rémy Oudompheng
 
Default libalpm: correctly load signatures for package files

A duplicate _alpm_pkg_new() call made libalpm load the signature
in a separate pmpkg_t that was leaked forever afterwards.

Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
---
This patch make the signatures for local files load
correctly.

On branch 'master'

lib/libalpm/be_package.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index a693247..d87d539 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -251,15 +251,16 @@ static pmpkg_t *pkg_load(const char *pkgfile, int full)
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
}

+ newpkg = _alpm_pkg_new();
+ if(newpkg == NULL) {
+ RET_ERR(PM_ERR_MEMORY, NULL);
+ }
+
/* attempt to stat the package file, ensure it exists */
if(stat(pkgfile, &st) == 0) {
char *pgpfile;
int sig_ret;

- newpkg = _alpm_pkg_new();
- if(newpkg == NULL) {
- RET_ERR(PM_ERR_MEMORY, NULL);
- }
newpkg->filename = strdup(pkgfile);
newpkg->size = st.st_size;

@@ -289,15 +290,6 @@ static pmpkg_t *pkg_load(const char *pkgfile, int full)
RET_ERR(PM_ERR_PKG_OPEN, NULL);
}

- newpkg = _alpm_pkg_new();
- if(newpkg == NULL) {
- archive_read_finish(archive);
- RET_ERR(PM_ERR_MEMORY, NULL);
- }
-
- newpkg->filename = strdup(pkgfile);
- newpkg->size = st.st_size;
-
_alpm_log(PM_LOG_DEBUG, "starting package load for %s
", pkgfile);

/* If full is false, only read through the archive until we find our needed
--
1.7.4.4
 

Thread Tools




All times are GMT. The time now is 07:22 AM.

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