From 9f873072b49c1afc40d7f734b31e6af088f0a21b Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 5 Oct 2014 08:14:17 +0200 Subject: [PATCH] bin/xbps-query/list.c: resource leak (CID 62690) --- bin/xbps-query/list.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/xbps-query/list.c b/bin/xbps-query/list.c index 5ad38468..f673680c 100644 --- a/bin/xbps-query/list.c +++ b/bin/xbps-query/list.c @@ -156,7 +156,8 @@ list_pkgs_pkgdb(struct xbps_handle *xhp) static int repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused) { - const char *signedby = NULL, *hexfp = NULL; + const char *signedby = NULL; + char *hexfp = NULL; uint16_t pubkeysize = 0; printf("%5zd %s", @@ -173,8 +174,10 @@ repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused) hexfp = xbps_pubkey2fp(repo->xhp, pubkey); if (signedby) printf(" Signed-by: %s\n", signedby); - if (pubkeysize && hexfp) + if (pubkeysize && hexfp) { printf(" %u %s\n", pubkeysize, hexfp); + free(hexfp); + } } return 0; }