Skip to content

Commit

Permalink
regex transformation: Fix a double free bug
Browse files Browse the repository at this point in the history
Supplying a bad regular expression to {re.subst} would lead to
a double pkg_free().

Credits to Nick Altmann for reporting / helping with troubleshooting

(cherry picked from commit 00d44e8)
  • Loading branch information
liviuchircu committed Jun 21, 2017
1 parent a2a9b79 commit a839da1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion re.c
Expand Up @@ -289,7 +289,6 @@ struct subst_expr* subst_parser(str* subst)
c=*re_end; /* regcomp expects null terminated strings -- save */
*re_end=0;
if (regcomp(regex, re, cflags)!=0){
pkg_free(regex);
*re_end=c; /* restore */
LM_ERR("bad regular expression %.*s in %.*s\n",
(int)(re_end-re), re, subst->len, subst->s);
Expand Down

0 comments on commit a839da1

Please sign in to comment.