Module: kamailio
Branch: master
Commit: 2ea19b82b5e21d4499929cb56964ed43035c6122
URL:
https://github.com/kamailio/kamailio/commit/2ea19b82b5e21d4499929cb56964ed4…
Author: Mikko Lehto <mslehto(a)iki.fi>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-28T10:39:23+02:00
sipt: free pkg memory on error
---
Modified: src/modules/sipt/sipt.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2ea19b82b5e21d4499929cb56964ed4…
Patch:
https://github.com/kamailio/kamailio/commit/2ea19b82b5e21d4499929cb56964ed4…
---
diff --git a/src/modules/sipt/sipt.c b/src/modules/sipt/sipt.c
index d583ca0101..f48de8d5ab 100644
--- a/src/modules/sipt/sipt.c
+++ b/src/modules/sipt/sipt.c
@@ -440,7 +440,7 @@ int sipt_parse_pv_name(pv_spec_p sp, str *in)
if(spv->sub_type == 0)
{
LM_ERR("Unknown SIPT subtype [%.*s]\n", pvsubtype.len, pvsubtype.s);
- return -1;
+ goto error;
}
break;
}
@@ -450,7 +450,7 @@ int sipt_parse_pv_name(pv_spec_p sp, str *in)
if(spv->type == 0)
{
LM_ERR("Unknown SIPT type [%.*s]\n",pvtype.len, pvtype.s);
- return -1;
+ goto error;
}
sp->pvp.pvn.u.dname = (void*)spv;
@@ -458,8 +458,9 @@ int sipt_parse_pv_name(pv_spec_p sp, str *in)
return 0;
error:
- LM_ERR("error at PV sipt name: %.*s\n", in->len, in->s);
- return -1;
+ LM_ERR("error at PV sipt name: %.*s\n", in->len, in->s);
+ pkg_free(spv);
+ return -1;
}