Module: kamailio
Branch: master
Commit: 5ea16d8de71324e2eeb3c833cde76c52bdc8ac67
URL:
https://github.com/kamailio/kamailio/commit/5ea16d8de71324e2eeb3c833cde76c5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-07-16T11:29:36+02:00
avpops: few more pkg free in case of errors in fixup functions
---
Modified: src/modules/avpops/avpops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5ea16d8de71324e2eeb3c833cde76c5…
Patch:
https://github.com/kamailio/kamailio/commit/5ea16d8de71324e2eeb3c833cde76c5…
---
diff --git a/src/modules/avpops/avpops.c b/src/modules/avpops/avpops.c
index 0a21418c19..c40edbf3a6 100644
--- a/src/modules/avpops/avpops.c
+++ b/src/modules/avpops/avpops.c
@@ -487,6 +487,7 @@ static int fixup_copy_avp(void** param, int param_no)
if (ap->u.sval->type!=PVT_AVP)
{
LM_ERR("you must specify only AVP as parameter\n");
+ pkg_free(ap);
return E_UNSPEC;
}
@@ -686,9 +687,9 @@ static int fixup_check_avp(void** param, int param_no)
LM_DBG("compiling regexp <%.*s>\n", ap->u.s.len, ap->u.s.s);
if (regcomp(re, ap->u.s.s,REG_EXTENDED|REG_ICASE|REG_NEWLINE))
{
+ LM_ERR("bad re <%.*s>\n", ap->u.s.len, ap->u.s.s);
pkg_free(re);
pkg_free(ap);
- LM_ERR("bad re <%.*s>\n", ap->u.s.len, ap->u.s.s);
return E_BAD_RE;
}
ap->u.s.s = (char*)re;
@@ -897,6 +898,7 @@ static int fixup_op_avp(void** param, int param_no)
if (ap->u.sval->type!=PVT_AVP)
{
LM_ERR("bad attribute name/alias <%s>!\n", s);
+ pkg_free(ap);
pkg_free(av[0]);
pkg_free(av);
return E_UNSPEC;