diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-09 10:20:36 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-08-09 15:33:01 +0200 |
commit | 8d0e5814ed9e37f122dc90980b407d7e99a4c1b0 (patch) | |
tree | b6a29778d2e4d76bd009169f7cbcfc997f9bc5b5 | |
parent | 79bf2b6e643764bf22aad9df9dc4b8c597243876 (diff) | |
download | gnutls-8d0e5814ed9e37f122dc90980b407d7e99a4c1b0.tar.gz |
gnutls_x509_privkey_import_pkcs8: fixed memory leak on incorrect key import
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/x509/privkey_pkcs8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c index b35a04aefd..0070288c58 100644 --- a/lib/x509/privkey_pkcs8.c +++ b/lib/x509/privkey_pkcs8.c @@ -1276,7 +1276,6 @@ decode_private_key_info(const gnutls_datum_t * der, error: asn1_delete_structure2(&pkcs8_asn, ASN1_DELETE_FLAG_ZEROIZE); - return result; } @@ -1393,7 +1392,8 @@ gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key, */ return 0; - cleanup: + cleanup: + asn1_delete_structure2(&key->key, ASN1_DELETE_FLAG_ZEROIZE); key->params.algo = GNUTLS_PK_UNKNOWN; if (need_free) _gnutls_free_datum(&_data); |