Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index c513b6b5..888ae15e 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1,7 +1,7 @@
/*
* sync.c
*
- * Copyright (c) 2006-2014 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-2015 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -410,7 +410,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
alpm_list_t *resolved = NULL;
- alpm_list_t *remove = NULL;
+ alpm_list_t *remove = alpm_list_copy(trans->remove);
alpm_list_t *localpkgs;
/* Build up list by repeatedly resolving each transaction package */
@@ -736,11 +736,11 @@ static int apply_deltas(alpm_handle_t *handle)
} else {
/* len = cachedir len + from len + '/' + null */
len = strlen(cachedir) + strlen(d->from) + 2;
- MALLOC(from, len, RET_ERR(handle, ALPM_ERR_MEMORY, 1));
+ MALLOC(from, len, free(delta); RET_ERR(handle, ALPM_ERR_MEMORY, 1));
snprintf(from, len, "%s/%s", cachedir, d->from);
}
len = strlen(cachedir) + strlen(d->to) + 2;
- MALLOC(to, len, free(from); RET_ERR(handle, ALPM_ERR_MEMORY, 1));
+ MALLOC(to, len, free(delta); free(from); RET_ERR(handle, ALPM_ERR_MEMORY, 1));
snprintf(to, len, "%s/%s", cachedir, d->to);
/* build the patch command */
@@ -862,7 +862,7 @@ static struct dload_payload *build_payload(alpm_handle_t *handle,
struct dload_payload *payload;
CALLOC(payload, 1, sizeof(*payload), RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
- STRDUP(payload->remote_name, filename, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
+ STRDUP(payload->remote_name, filename, FREE(payload); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
payload->max_size = size;
payload->servers = servers;
return payload;