Nullify pattern after failed regcomp
This commit is contained in:
parent
882c5ab2bd
commit
c05c784bea
@ -86,7 +86,8 @@ optpat()
|
||||
patlock = 0;
|
||||
if (n = regcomp(exp, exps, 0)) {
|
||||
regerror(n, exp, errmsg, sizeof errmsg);
|
||||
return NULL;
|
||||
free(exp);
|
||||
return exp = NULL;
|
||||
}
|
||||
return exp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user