blob: 6567d2586fdb9c4c4714b4ba24126c0cfcb75de2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
From 4a8db9d50f8281930678ed6f06692545293f3c9d Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Fri, 12 Jul 2019 15:38:43 +0900
Subject: [PATCH] onig_new_deluxe: don't free new pattern if success
On onig_new_deluxe() success (r == 0), new pattern (cpat) is used in
einfo->pattern, so don't free this.
---
src/regext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/regext.c b/src/regext.c
index fa4b360..920d183 100644
--- a/src/regext.c
+++ b/src/regext.c
@@ -196,7 +196,7 @@ onig_new_deluxe(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
}
err2:
- if (cpat != pattern) xfree(cpat);
+ if (r && (cpat != pattern)) xfree(cpat);
return r;
}
--
2.21.0
|