From 0f26e3aa5b91ffc0a5bef9a0f0bb9d40ec198407 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 16 Jun 2011 13:03:33 -0500 Subject: Correctly duplicate delta objects We were using copy_data before; this works for the struct itself but not the strings contained within. Fix it up by duplicating all the data as we do with our other structures. Signed-off-by: Dan McGee --- lib/libalpm/package.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index ff011982..0b0e9741 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -466,7 +466,9 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) newpkg->optdepends = alpm_list_strdup(pkg->optdepends); newpkg->conflicts = alpm_list_strdup(pkg->conflicts); newpkg->provides = alpm_list_strdup(pkg->provides); - newpkg->deltas = alpm_list_copy_data(pkg->deltas, sizeof(pmdelta_t)); + for(i = pkg->deltas; i; i = alpm_list_next(i)) { + newpkg->deltas = alpm_list_add(newpkg->deltas, _alpm_delta_dup(i->data)); + } /* internal */ newpkg->infolevel = pkg->infolevel; -- cgit v1.2.3-24-g4f1b