Skip to content

Commit

Permalink
avpops: few more pkg free in case of errors in fixup functions
Browse files Browse the repository at this point in the history
(cherry picked from commit 5ea16d8)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent e01ff34 commit 0827f0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/avpops/avpops.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0827f0e

Please sign in to comment.