freeing X509 structures

2010-04-28 Thread Matt Fioravante
I've got some code that dynamically allocates an X509 object using
PEM_read_X509 and then extracts some data from it.

The problem is the object never gets freed. I tried to call free() on the
X509 pointer but that doesn't work either because it has dynamically
allocated sub structures. Is there any nice abstracted function for freeing
these objects or do I have to dive into the struct itself and manually free
everything? (which might all the sudden not work anymore if a new version of
openssl comes out that changes the struct)

I looked around in the x509 headers and didn't see anything.

Thanks!


Re: freeing X509 structures

2010-04-28 Thread Bruce Stephens
Matt Fioravante fmatthew5...@gmail.com writes:

 I've got some code that dynamically allocates an X509 object using 
 PEM_read_X509 and then extracts some data from it.

 The problem is the object never gets freed. I tried to call free() on the 
 X509 pointer but that doesn't work either because it has dynamically 
 allocated sub structures. Is
 there any nice abstracted function for freeing these objects or do I have to 
 dive into the struct itself and manually free everything? (which might all 
 the sudden not work
 anymore if a new version of openssl comes out that changes the struct)

 I looked around in the x509 headers and didn't see anything.

X509_free()?
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org