<p>Hi,</p>

<p>Don't know how much it is important but it's worth looking at it.</p>

<p>Regarding the following block (modparam.c around line 88):</p>

<pre><code>if (param-&gt;type&amp;USE_FUNC_PARAM) {
    n = ((param_func_t)(param-&gt;param_pointer))(type, val );
    if (n&lt;0)
        return -4;
} else {
    switch(type) {
        case STR_PARAM:
            *((char**)(param-&gt;param_pointer)) = strdup((char*)val);
            break;
        case INT_PARAM:
            *((int*)(param-&gt;param_pointer)) = (int)(long)val;
            break;
    }
}
</code></pre>

<p>When the USE_FUNC_PARAM flag is set, and the module parameter type is STR_PARAM, the actual string is not duplicated before it is passed to the function.<br>
However, it is duplicated if only the STR_PARAM flag is set.<br>
The string is allocated in the parser code but I don't know if it deallocated after parsing is done, in which case not duplicating it may be a problem.</p>

<p>Regards,<br>
Mickael</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/349">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODExMzY5OCwiZGF0YSI6eyJpZCI6NDQ4MDUwMDF9fQ==--bd8309bd2cbc89b0e5bef118fb49ff746b2e8221.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/OpenSIPS/opensips/issues/349","name":"View Issue"}}</script>