summaryrefslogtreecommitdiffstats
path: root/src/collectors/log2journal/log2journal-pcre2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/collectors/log2journal/log2journal-pcre2.c')
-rw-r--r--src/collectors/log2journal/log2journal-pcre2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/collectors/log2journal/log2journal-pcre2.c b/src/collectors/log2journal/log2journal-pcre2.c
index 185e69108..77f804cc8 100644
--- a/src/collectors/log2journal/log2journal-pcre2.c
+++ b/src/collectors/log2journal/log2journal-pcre2.c
@@ -102,8 +102,15 @@ PCRE2_STATE *pcre2_parser_create(LOG_JOB *jb) {
}
void pcre2_parser_destroy(PCRE2_STATE *pcre2) {
- if(pcre2)
+ if(pcre2) {
+ if(pcre2->re)
+ pcre2_code_free(pcre2->re);
+
+ if(pcre2->match_data)
+ pcre2_match_data_free(pcre2->match_data);
+
freez(pcre2);
+ }
}
const char *pcre2_parser_error(PCRE2_STATE *pcre2) {