Bugs item #3411434, was opened at 2011-09-19 13:28 Message generated for change (Comment added) made by wdoekes 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: Walter Doekes (wdoekes) Date: 2011-09-21 15:10 Message: Sure. I don't mind either way. However, for the sake of arguing I could say the following: on success, it's still your own memory, but free_to() free's it. What's up with that? ;) What I do care about is that if you *do* free_to_params on error, I think param_lst should be (re)set to 0. That way those that *do* call free_to, won't get a double free. Regards, Walter Doekes ---------------------------------------------------------------------- Comment By: Vladut-Stefan Paiu (vladut-paiu) Date: 2011-09-21 13: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 _______________________________________________ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel