<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 10/17/2017 08:39 AM, Adi Mallikarjuna Reddy V wrote:<br>
<blockquote type="cite"
cite="mid:CABexLuasQ3s7XdeOJ_8gi4kqcxnMuPLpnO9z5PeG56WvBE7_SQ@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr"><span style="font-size:12.8px">Hi,</span>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">If I have an X509 object and is
created using PEM_read_bio_X509_AUX(), then Can I free X509
right after the completion of PEM_read_bio_X509_AUX()?</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">
<div> BIO *cert_bio =
BIO_new(BIO_s_mem());</div>
<div> X509 *cert = X509_new();</div>
<div> BIO_puts(cert_bio,
cert_str.c_str());</div>
<div> cert =
PEM_read_bio_X509_AUX(cert_<wbr>bio, &cert, NULL, NULL);</div>
<div> if ( (cert != NULL)
&& SSL_CTX_use_certificate(ctx, cert) < 1) {</div>
<div>
SSL_CTX_free(ctx);</div>
</div>
</div>
</blockquote>
<br>
Yes.<br>
<br>
-Ben<br>
<br>
<blockquote type="cite"
cite="mid:CABexLuasQ3s7XdeOJ_8gi4kqcxnMuPLpnO9z5PeG56WvBE7_SQ@mail.gmail.com">
<div dir="ltr">
<div style="font-size:12.8px">
<div> return NULL;</div>
<div> }</div>
<div> </div>
<div> if(cert_bio !=NULL) {</div>
<div>
BIO_free(cert_bio);</div>
<div> }</div>
<div> if(cert != NULL) {</div>
<div> X509_free(cert);
//is it needed?</div>
<div> }</div>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Thanks</div>
<div style="font-size:12.8px">Adi</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</body>
</html>