Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix memleak: free regex when parsing fails
Browse files Browse the repository at this point in the history
fixes #2541
  • Loading branch information
stapelberg committed Aug 28, 2017
1 parent f1e6d4e commit c4474ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/regex.c
Expand Up @@ -38,6 +38,7 @@ struct regex *regex_new(const char *pattern) {
}
ELOG("PCRE regular expression compilation failed at %d: %s\n",
offset, error);
regex_free(re);
return NULL;
}
re->extra = pcre_study(re->regex, 0, &error);
Expand Down

0 comments on commit c4474ad

Please sign in to comment.