diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-06-02 16:05:46 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-06-02 16:05:46 +0200 |
commit | 18e7a1192d85e8706899bd7b9c727d4f01b14046 (patch) | |
tree | 44d342dca7fd4b2c932fc2121b245bc58a7e873c /lib/x509/pkcs7.c | |
parent | ad2794930fa93d53d6f6aff945935c3db9c64a5f (diff) | |
download | gnutls-18e7a1192d85e8706899bd7b9c727d4f01b14046.tar.gz |
_decode_pkcs7_signed_data: fixed mem leaks
Diffstat (limited to 'lib/x509/pkcs7.c')
-rw-r--r-- | lib/x509/pkcs7.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c index 6dd385fe48..55cd7bd799 100644 --- a/lib/x509/pkcs7.c +++ b/lib/x509/pkcs7.c @@ -105,17 +105,20 @@ _decode_pkcs7_signed_data(ASN1_TYPE pkcs7, ASN1_TYPE * sdata) result = asn1_read_value(c2, "encapContentInfo.eContentType", oid, &len); if (result != ASN1_SUCCESS) { gnutls_assert(); - return _gnutls_asn2err(result); + result = _gnutls_asn2err(result); + goto cleanup; } if (strcmp(oid, PLAIN_DATA_OID) != 0 && strcmp(oid, DIGESTED_DATA_OID) != 0) { gnutls_assert(); _gnutls_debug_log("Unknown or unexpected PKCS7 Encapsulated Content OID '%s'\n", oid); - return GNUTLS_E_UNKNOWN_PKCS_CONTENT_TYPE; + result = GNUTLS_E_UNKNOWN_PKCS_CONTENT_TYPE; + goto cleanup; } *sdata = c2; + gnutls_free(tmp.data); return 0; cleanup: |