Skip to content

Commit

Permalink
Fix a memory leak when using pcre2
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin committed May 8, 2021
1 parent 916a9d7 commit db14b85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sp_pcre_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ bool ZEND_HOT sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str,
sp_log_err("regexp", "Unable to get memory for a regxp.");
}
ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL);
pcre2_match_data_free(match_data);
#else
int vec[30];
ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec, sizeof(vec) / sizeof(int));
Expand Down

0 comments on commit db14b85

Please sign in to comment.