> -----Original Message-----
> Greetings All,
> 
> I have a ques about X509_free() vs. EVP_PKEY_free().
> In my init code (err logic removed) I get the key using:
> 
>       x509 = PEM_read_X509(fp, NULL, NULL, NULL);
>       SrvPubKey = X509_get_pubkey(x509);
>       X509_free(x509);
> 
> And later in my exit code I use:
>       EVP_PKEY_free(SrvPubKey);
> which seg faults.
> 
> Did my X509_free() in the init free the data already? I assumed that
> get_pubkey() returned a new pointer, hence the existence and/or
> requirement of the EVP_PKEY_free() func right?
> 
> Am I using this incorrectly?
> 
> Thanks,
> Dann

Oops, I found the problem.
I was calling EVP_PKEY_free(SrvPubKey) elsewhere in the code as well!
So sorry to have wasted anyone's time.

Best,
Dann

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to