summaryrefslogtreecommitdiff
path: root/sample/sql.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/sql.c')
-rw-r--r--sample/sql.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sample/sql.c b/sample/sql.c
index 8e95f70..1602ac9 100644
--- a/sample/sql.c
+++ b/sample/sql.c
@@ -42,6 +42,7 @@ extern int main(int argc, char* argv[])
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r, &einfo);
fprintf(stderr, "ERROR: %s\n", s);
+ onig_end();
return -1;
}
@@ -66,6 +67,9 @@ extern int main(int argc, char* argv[])
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);
+ onig_end();
return -1;
}