From ace9520193d98746644e44d0226a1414876d130b Mon Sep 17 00:00:00 2001 From: nils Date: Sun, 24 Oct 2004 17:20:29 +0000 Subject: [PATCH] fix memory leak git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1951 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/tools/pkcs15-init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c index f10a06fc..cd70d755 100644 --- a/src/tools/pkcs15-init.c +++ b/src/tools/pkcs15-init.c @@ -305,7 +305,7 @@ static struct sc_pkcs15init_callbacks callbacks = { int main(int argc, char **argv) { - struct sc_profile *profile; + struct sc_profile *profile = NULL; unsigned int n; int r = 0; @@ -419,6 +419,9 @@ main(int argc, char **argv) } out: + if (profile) { + sc_pkcs15init_unbind(profile); + } if (card) { sc_unlock(card); sc_disconnect_card(card, 0);