<p></p>
<p>I have checked openssl sources, loogs as <code>BIO_printf</code> and <code>BIO_write</code> function to not use lock mechanism.</p>
<blockquote>
<p>The solution would be to either have a lock around and do every time: lock, open file, write, close, unlock;</p>
</blockquote>
<p>Why we cannot open file once and use logic inside childs</p>
<pre><code>lock, write, unlock
</code></pre>
<blockquote>
<p>I also noticed that the file name is reallocated in pkg using a local variable in a function and not freed.</p>
</blockquote>
<p>is memory allocated here and not freed?</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-mdr">@@ -636,6 +710,7 @@</span> int tls_h_mod_pre_init_f(void)
 #endif
        SSL_load_error_strings();
        tls_mod_preinitialized=1;
<span class="pl-mi1"><span class="pl-mi1">+</span>       prepare_keylog_file(cfg_get(tls, tls_cfg, session_keylog_filename));</span>
        return 0;
 }
</pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2785#issuecomment-869498796">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZPAG4JL2MHE63NQYKDTVAZSXANCNFSM47BQRZIA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZP2GBMTLYQ56HWFOR3TVAZSXA5CNFSM47BQRZIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGPJX7LA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2785#issuecomment-869498796",
"url": "https://github.com/kamailio/kamailio/pull/2785#issuecomment-869498796",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>