Skip to content

Commit

Permalink
sipt: free pkg memory on error
Browse files Browse the repository at this point in the history
(cherry picked from commit 2ea19b8)
  • Loading branch information
mslehto authored and miconda committed Aug 30, 2017
1 parent 8fe9b71 commit bc0041f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/sipt/sipt.c
Expand Up @@ -433,7 +433,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;
}
Expand All @@ -443,16 +443,17 @@ 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;
sp->pvp.pvn.type = PV_NAME_OTHER;

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;

}

Expand Down

0 comments on commit bc0041f

Please sign in to comment.