[OpenSER-Devel] [ openser-Bugs-1855861 ] Possible memleak in pseudo variables code
SourceForge.net
noreply at sourceforge.net
Sun Dec 23 08:57:58 UTC 2007
Bugs item #1855861, was opened at 2007-12-21 23:31
Message generated for change (Comment added) made by rubel001
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1855861&group_id=139143
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: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dan (dan_pascu)
Assigned to: Nobody/Anonymous (nobody)
Summary: Possible memleak in pseudo variables code
Initial Comment:
The functions pv_parse_hdr_name, pv_parse_avp_name and pv_parse_index allocate a nsp variable and after that call pv_parse_spec. If pv_parse_spec is not successful, the functions return without freeing nsp. I'm not sure if pv_parse_spec retains a reference to nsp, but if not there is clearly a mem leak.
----------------------------------------------------------------------
Comment By: Salahuddin Ahmed (rubel001)
Date: 2007-12-23 14:57
Message:
Logged In: YES
user_id=1953307
Originator: NO
Possible solution of this memleak:
patch:
===========================================================
--- pvar.c 2007-12-17 16:41:29.000000000 +0600
+++ pvar_my_patch.c 2007-12-23 14:12:01.000000000 +0600
@@ -2225,6 +2225,7 @@
if(p==NULL)
{
LM_ERR("invalid name [%.*s]\n", in->len, in->s);
+ pkg_free(nsp);
return -1;
}
//LM_ERR("dynamic name [%.*s]\n", in->len, in->s);
@@ -2286,6 +2287,7 @@
if(s==NULL)
{
LM_ERR("invalid name [%.*s]\n", in->len, in->s);
+ pkg_free(nsp);
return -1;
}
//LM_ERR("dynamic name [%.*s]\n", in->len, in->s);
@@ -2327,6 +2329,7 @@
if(s==NULL)
{
LM_ERR("invalid index [%.*s]\n", in->len, in->s);
+ pkg_free(nsp);
return -1;
}
sp->pvp.pvi.type = PV_IDX_PVAR;
===========================================================
Regards,
bd [dot] rubel [at] gmail [dot] com
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1855861&group_id=139143
More information about the Devel
mailing list