----- Original Message -----
From: Ray O'Hagan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 07, 2000 1:23 PM
Subject: X509_NAME_free core dump.
> I'm having problems with X509_NAME_free - each time I call
> it, it core dumps. This happens every time on Win98 and occasionally
> on Solaris. Has anyone come across a similar problem ? Any help/pointers
> would be greatly appreciated. I've included the code I'm using below.
Take a look at X509_get_subject_name and X509_NAME_get_entry.
They don't allocate any memory...
So you must NOT free the objects, which they return.
Else you free the same memory 3 times:
First you free the entries within the name,
then you free the name (and the entries again),
then you probably free the certificate, together with the name and it's
entries - 3d time!
So, my suggestion is: just drop those two lines:
> X509_NAME_ENTRY_free(ne);
> X509_NAME_free(name);
Also, there are much easier ways to retrieve the commonName from X509_NAME
than enumerating
all the entries, e.g. X509_NAME_get_text_by_NID;
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]