aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2014-12-19 16:30:10 +0100
committerTobias Brunner <tobias@strongswan.org>2014-12-19 16:30:10 +0100
commita6c0dec0e5dfe86e2e9ebe6ea09f43f43ae7fab4 (patch)
tree27de2820f99bed051e247ee1f62568805c046670
parent8edea13a5a0812ee430b53b46bff0115585b0566 (diff)
downloadstrongswan-a6c0dec0e5dfe86e2e9ebe6ea09f43f43ae7fab4.tar.bz2
strongswan-a6c0dec0e5dfe86e2e9ebe6ea09f43f43ae7fab4.tar.xz
pki: Properly clean up if output format for --pkcs12 is wrong
-rw-r--r--src/pki/commands/pkcs12.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pki/commands/pkcs12.c b/src/pki/commands/pkcs12.c
index fe92fa810..67f026843 100644
--- a/src/pki/commands/pkcs12.c
+++ b/src/pki/commands/pkcs12.c
@@ -75,6 +75,7 @@ static int export(pkcs12_t *pkcs12, int index, char *outform)
form = CERT_ASN1_DER;
if (outform && !get_form(outform, &form, CRED_CERTIFICATE))
{
+ enumerator->destroy(enumerator);
return command_usage("invalid output format");
}
if (cert->get_encoding(cert, form, &encoding))
@@ -103,6 +104,7 @@ static int export(pkcs12_t *pkcs12, int index, char *outform)
form = PRIVKEY_ASN1_DER;
if (outform && !get_form(outform, &form, CRED_PRIVATE_KEY))
{
+ enumerator->destroy(enumerator);
return command_usage("invalid output format");
}
if (key->get_encoding(key, form, &encoding))