<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/06/2015 05:22, Nayna Jain wrote:<br>
</div>
<blockquote
cite="mid:OF2512B4B1.C5A5D333-ON65257E60.00123A5A-65257E60.00127F9D@in.ibm.com"
type="cite">
<p><font face="sans-serif" size="2">Hi all,</font><br>
<br>
<font face="sans-serif" size="2">I am using X509_STORE and
X509_LOOKUP to verify the certificate and its chain.</font><br>
<br>
<font face="sans-serif" size="2">But at the end when I do
X509_STORE_free(store) and X509_LOOKUP_free(lookup), it is
also doing free of the X509* certificate which I added.</font><br>
<font face="sans-serif" size="2">But I don't want that, because
after that when I immediately try to access X509* certificate
for further operation, then it results in core dump</font><br>
<br>
<font face="sans-serif" size="2">And if I don't do
X509_STORE_free() then it will leave the memory leak.</font><br>
<font face="sans-serif" size="2"><br>
Let me know how to resolve this and if I misunderstood
something.</font><br>
</p>
</blockquote>
<tt>X509 objects (and many other objects in the API) are <br>
reference counted.</tt><tt><br>
</tt><tt><br>
</tt><tt>Increment the reference count of each certificate as <br>
you add it to the X509_STORE, this should make the <br>
X509 object stay around after X509_STORE_free() frees <br>
it.</tt><tt><br>
<br>
However there is a shortage of documentation on the <br>
reference counting functions involved.<br>
<br>
</tt>
<pre class="moz-signature" cols="72">Enjoy
Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. <a class="moz-txt-link-freetext" href="http://www.wisemo.com">http://www.wisemo.com</a>
Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded </pre>
</body>
</html>