summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-06-12 09:48:29 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-06-12 09:48:29 +0300
commitf08fee95281c56f393bd9822c5daaa9cdc2b6b06 (patch)
tree946e4615fda97cf1497e986be92eddd268a250eb
parent36d730e95d8b717e0bc76449d991973e985afdab (diff)
downloadapk-tools-f08fee95281c56f393bd9822c5daaa9cdc2b6b06.tar.gz
apk-tools-f08fee95281c56f393bd9822c5daaa9cdc2b6b06.tar.bz2
apk-tools-f08fee95281c56f393bd9822c5daaa9cdc2b6b06.tar.xz
apk-tools-f08fee95281c56f393bd9822c5daaa9cdc2b6b06.zip
fix search --has-origin to not leak memory
-rw-r--r--src/search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 5833325..2e47070 100644
--- a/src/search.c
+++ b/src/search.c
@@ -130,7 +130,7 @@ static void print_result_pkg(struct search_ctx *ctx, struct apk_package *pkg)
}
if (ctx->search_origin) {
foreach_array_item(pmatch, ctx->filter) {
- if (pkg->origin != NULL && strcmp(*pmatch, apk_blob_cstr(*pkg->origin)) == 0)
+ if (pkg->origin && apk_blob_compare(APK_BLOB_STR(*pmatch), *pkg->origin) == 0)
goto match;
}
return;