summaryrefslogtreecommitdiff
path: root/sample/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/syntax.c')
-rw-r--r--sample/syntax.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sample/syntax.c b/sample/syntax.c
index e292079..e034608 100644
--- a/sample/syntax.c
+++ b/sample/syntax.c
@@ -45,6 +45,8 @@ extern int exec(OnigSyntaxType* syntax, char* apattern, char* astr)
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r);
fprintf(stderr, "ERROR: %s\n", s);
+ onig_region_free(region, 1 /* 1:free self, 0:free contents only */);
+ onig_free(reg);
return -1;
}