summaryrefslogtreecommitdiff
path: root/lib/x509/pkcs7.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-06-02 16:05:46 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-06-02 16:05:46 +0200
commit18e7a1192d85e8706899bd7b9c727d4f01b14046 (patch)
tree44d342dca7fd4b2c932fc2121b245bc58a7e873c /lib/x509/pkcs7.c
parentad2794930fa93d53d6f6aff945935c3db9c64a5f (diff)
downloadgnutls-18e7a1192d85e8706899bd7b9c727d4f01b14046.tar.gz
_decode_pkcs7_signed_data: fixed mem leaks
Diffstat (limited to 'lib/x509/pkcs7.c')
-rw-r--r--lib/x509/pkcs7.c7
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: