[OpenSIPS-Devel] [opensips] Modparam string not duplicated when USE_FUNC_PARAM flag set (#349)
Bogdan Andrei IANCU
notifications at github.com
Thu Oct 16 12:52:33 CEST 2014
Hi @mikomarrache - the val points into parser memory (lex/yacc) and it is no longer available after the script parsing was done.
When having the a STR param, it is a must to clone it as the module gets access to that param only after the cfg parsing.
With the function, this function is called during the cfg parsing, so there is no need to clone the val. OF course, the function should not keep the val pointer after its ending. If it needs to store the val, the function itself must do the cloning.
So, the code is ok, but you need to be careful in param functions and clone the val if you need it outside function scope.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel