From 2445175d3f73add28690910018821c275d781fa4 Mon Sep 17 00:00:00 2001 From: levitte Date: Sun, 5 Oct 2008 08:00:13 +0000 Subject: [PATCH] Only try to close the key if we got one... git-svn-id: https://yubikey-personalization.googlecode.com/svn/trunk@30 b62f149e-849f-11dd-9899-c7ba65f7c4c7 --- ykpersonalize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ykpersonalize.c b/ykpersonalize.c index e2a2886..5fbfc36 100644 --- a/ykpersonalize.c +++ b/ykpersonalize.c @@ -220,7 +220,8 @@ main(int argc, char **argv) fclose(inf); if (outf) fclose(outf); - if (!yk_close_key(yk)) { + + if (yk && !yk_close_key(yk)) { report_yk_error(); exit_code = 2; } -- 2.39.5