[OpenSIPS-Devel] [ opensips-Bugs-3411434 ] lack of free_to_params in many places

SourceForge.net noreply at sourceforge.net
Wed Sep 21 13:13:39 CEST 2011


Bugs item #3411434, was opened at 2011-09-19 14:28
Message generated for change (Comment added) made by vladut-paiu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3411434&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: trunk
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Walter Doekes (wdoekes)
Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: lack of free_to_params in many places

Initial Comment:
Hi,

free_to_params is not called (implicitly) nearly as often as it should.

See attached patch.

Note: I removed the free_to_params from parse_to_params as it could cause double frees. Convention seems to be that one should call it.
Note: I only tested the parse_to functionality. Other parts of the patch are checked for compilation errors only.

Version 1.6 is also affected (as probably others too).

Regards,
Walter Doekes
OSSO B.V.

See also: http://sip-router.org/tracker/index.php?do=details&task_id=155

----------------------------------------------------------------------

>Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2011-09-21 14:13

Message:
Hello Walter,

Thank you for the patch, but I have to disagree a little.
I find it more logical that, when parse_to returns error, it still does
free_to_params() internally. So, in case of error, parse_to will free the
memory that it allocated, and it is your responsability to deallocate your
own memory.
In case of success, it is your responsability to free both your memory,
and the memory allocated on the fly by parse_to.

Still, some elements in your patch remain valid ( leak in osp and b2b ). I
will take a closer look and fix those.

Regards,
Vlad

Regards,
Vlad


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3411434&group_id=232389



More information about the Devel mailing list