[OpenSIPS-Devel] [ opensips-Bugs-3538551 ] The source code may be bug

SourceForge.net noreply at sourceforge.net
Thu Jun 28 05:52:50 CEST 2012


Bugs item #3538551, was opened at 2012-06-27 20:52
Message generated for change (Tracker Item Submitted) made by luodaidong
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3538551&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: modules
Group: 1.8.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: luodaidong (luodaidong)
Assigned to: Nobody/Anonymous (nobody)
Summary: The source code may be bug

Initial Comment:
In the modules tm, The t_fwd.c has a function whose name is pre_print_uac_request;
I don't understand the following source code, this may has memory leak, and the source code  is bad.
if (t->on_branch) {
		/* need to pkg_malloc the dst_uri */
		if ( request->dst_uri.s && request->dst_uri.len>0 ) {
			if ( (p=pkg_malloc(request->dst_uri.len))==0 ) {
				LM_ERR("no more pkg mem\n");
				ser_error=E_OUT_OF_MEM;
				goto error;
			}
			memcpy( p, request->dst_uri.s, request->dst_uri.len);
			request->dst_uri.s = p;
		}
		/* need to pkg_malloc the new_uri */
		if ( (p=pkg_malloc(request->new_uri.len))==0 ) {
			LM_ERR("no more pkg mem\n");
			ser_error=E_OUT_OF_MEM;
			goto error;
		}
		memcpy( p, request->new_uri.s, request->new_uri.len);
		request->new_uri.s = p;




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

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



More information about the Devel mailing list