From ed6cadd6c72e376337158e83ce3b9bc1c70c1f6a Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Thu, 21 Mar 2024 16:37:37 +0100 Subject: [PATCH] Fix potential memory leak --- tools/credman.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/credman.c b/tools/credman.c index a0a3149d..dc239d0b 100644 --- a/tools/credman.c +++ b/tools/credman.c @@ -127,6 +127,8 @@ print_rk(const fido_credman_rk_t *rk, size_t idx) if (base64_encode(fido_cred_id_ptr(cred), fido_cred_id_len(cred), &id) < 0 || base64_encode(fido_cred_user_id_ptr(cred), fido_cred_user_id_len(cred), &user_id) < 0) { + free(user_id); + free(id); warnx("output error"); return -1; }