summaryrefslogtreecommitdiff
path: root/sample/crnl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/crnl.c')
-rw-r--r--sample/crnl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sample/crnl.c b/sample/crnl.c
index 3ad1210..bfa563e 100644
--- a/sample/crnl.c
+++ b/sample/crnl.c
@@ -65,6 +65,8 @@ x(int no, char* pattern_arg, char* str_arg,
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(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;
}