<p></p>
<p>Actually, I think it is better that the new pointer variables are still declared <code>static</code> in the <code>.c</code> files needing them, with a function that initializes them (for use in mod_init()) and another one that destroys them (in mod_destroy(). Practically copy the memory allocation/free code to their own functions in the files declaring the static pointers and expose them in <code>.h</code> files use from main file of the module.</p>
<p>Otherwise, some variables have pretty generic name (e.g., db_keys) and can confuse some linkers and can mess up references at runtime.</p>

<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/2891#issuecomment-952833907">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZPAQ3ONMYGKCJ5DOC3UI7XILANCNFSM5GNRVCXA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZPMIVRW5E3HNTHZBYDUI7XILA5CNFSM5GNRVCXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHDFRO4Y.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/2891#issuecomment-952833907",
"url": "https://github.com/kamailio/kamailio/pull/2891#issuecomment-952833907",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>