Hi All,

I have several questions associated with freeing resources of X509 struct.

snippet of my code:
X509 *x509Cert = X509_new();
if (x509Cert == NULL) printf("Error instantiating X509 object\n");

/* do some processing with my x509Cert object */

/* Cleaning up resources of x509Cert */
if(x509Cert != NULL) X509_free(x509Cert);

My questions are:
1. How to check that x509Cert resources have been freed?  I notice that
X509_free(x509Cert) does not set the x509Cert to NULL, therefore I can not
rely on if(x509Cert != NULL) to verify that x509Cert resources has been
freed.  this a bug or there are other method for verifying whether x509Cert
resources have been freed.
2. Does X509_free() also free all the internal objects that are part of the
X509 struct; e.g. X509_ALGOR, X509_NAME, ASN1_INTEGER, ASN1_TIME, etc

Thanks,
Erwin

Reply via email to