From 68becc8fc491cc27a7eb3f8cd8e5291308457f7c Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 29 Apr 2015 23:22:28 +0200 Subject: [PATCH] pkcs15-gpk: fixed resource leak --- src/pkcs15init/pkcs15-gpk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkcs15init/pkcs15-gpk.c b/src/pkcs15init/pkcs15-gpk.c index e6502d96..c6cb63d9 100644 --- a/src/pkcs15init/pkcs15-gpk.c +++ b/src/pkcs15init/pkcs15-gpk.c @@ -717,7 +717,8 @@ gpk_pkfile_init_public(sc_profile_t *profile, sc_pkcs15_card_t *p15card, sc_file if (r >= 0) { if (r != 7 || buffer[0] != 0) { sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "first record of public key file is not Lsys0"); - return SC_ERROR_OBJECT_NOT_VALID; + r = SC_ERROR_OBJECT_NOT_VALID; + goto out; } r = sc_update_record(p15card->card, 1, sysrec, sizeof(sysrec),