<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/18222">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging: do not allow multiple calls of log_init()<br><br>calling log_init() multiple times would lead into memory leaks. The<br>function should only be called once on startup of the process. Lets make<br>sure that it does not get called multiple times by accident.<br><br>Change-Id: Ibb300e4c9b04767581116ab530b2e6a9a195db08<br>---<br>M src/logging.c<br>1 file changed, 3 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/logging.c b/src/logging.c</span><br><span>index 4aaf515..c14e696 100644</span><br><span>--- a/src/logging.c</span><br><span>+++ b/src/logging.c</span><br><span>@@ -1028,6 +1028,9 @@</span><br><span>   int i;</span><br><span>       struct log_info_cat *cat_ptr;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* Ensure that log_init is not called multiple times */</span><br><span style="color: hsl(120, 100%, 40%);">+       OSMO_ASSERT(tall_log_ctx == NULL)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  tall_log_ctx = talloc_named_const(ctx, 1, "logging");</span><br><span>      if (!tall_log_ctx)</span><br><span>           return -ENOMEM;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/18222">change 18222</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/18222"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibb300e4c9b04767581116ab530b2e6a9a195db08 </div>
<div style="display:none"> Gerrit-Change-Number: 18222 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>