summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-07 17:45:04 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-07 17:45:04 +0300
commitf85d87e5f9d0572bbb04ecb9aaad47f9c15b1703 (patch)
treee10bec50c5a305fea150c4df840faf26c134054a /src/database.c
parent7be853e63785276338a4c4d9e5be084f24114bed (diff)
downloadapk-tools-f85d87e5f9d0572bbb04ecb9aaad47f9c15b1703.tar.gz
apk-tools-f85d87e5f9d0572bbb04ecb9aaad47f9c15b1703.tar.bz2
apk-tools-f85d87e5f9d0572bbb04ecb9aaad47f9c15b1703.tar.xz
apk-tools-f85d87e5f9d0572bbb04ecb9aaad47f9c15b1703.zip
db: fix usage of apk_name_array in install_ctx
got broken to the previous array cleanup and grepping struct definition only from headers.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c
index 2e886c2..7421e1b 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1753,10 +1753,10 @@ static int apk_db_install_archive_entry(void *_ctx,
if (opkg->name == pkg->name)
break;
/* Overwriting with permission? */
- for (i = 0; ctx->replaces && i < ctx->replaces->num; i++)
+ for (i = 0; i < ctx->replaces->num; i++)
if (opkg->name == ctx->replaces->item[i])
break;
- if (ctx->replaces && i < ctx->replaces->num)
+ if (i < ctx->replaces->num)
break;
if (!(apk_flags & APK_FORCE)) {
@@ -2027,13 +2027,13 @@ static int apk_db_unpack_pkg(struct apk_database *db,
.cb = cb,
.cb_ctx = cb_ctx,
};
+ apk_name_array_init(&ctx.replaces);
apk_sign_ctx_init(&ctx.sctx, APK_SIGN_VERIFY_IDENTITY, &pkg->csum, db->keys_fd);
tar = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, &ctx.sctx);
r = apk_tar_parse(tar, apk_db_install_archive_entry, &ctx, TRUE);
apk_sign_ctx_free(&ctx.sctx);
+ apk_name_array_free(&ctx.replaces);
tar->close(tar);
- if (ctx.replaces)
- free(ctx.replaces);
if (need_copy) {
if (r == 0)