diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-06-06 11:26:07 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-06-06 11:26:07 +0000 |
commit | 6cb9fca70d5878fde11b5f16fee259c49f936d1c (patch) | |
tree | b2a25ee1021d313aeae6c821d2f911110c5ec79f /crypto/asn1 | |
parent | ec0bfca7e771e08a09c0be307ec56427e0f8461b (diff) |
Fix memory leak. The canonical X509_NAME_ENTRY STACK is reallocated rather
than referencing existing X509_NAME_ENTRY structures so needs to be
completely freed.
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/x_name.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 3c9344c17f..b46434c7bd 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -244,6 +244,11 @@ static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne) sk_X509_NAME_ENTRY_free(ne); } +static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne) + { + sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free); + } + static int x509_name_encode(X509_NAME *a) { union { STACK_OF(STACK_OF_X509_NAME_ENTRY) *s; @@ -372,7 +377,7 @@ static int x509_name_canon(X509_NAME *a) X509_NAME_ENTRY_free(tmpentry); if (intname) sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname, - local_sk_X509_NAME_ENTRY_free); + local_sk_X509_NAME_ENTRY_pop_free); return ret; } |