summaryrefslogtreecommitdiff
path: root/sample/user_property.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/user_property.c')
-rw-r--r--sample/user_property.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sample/user_property.c b/sample/user_property.c
index 8b2abd2..d52adc0 100644
--- a/sample/user_property.c
+++ b/sample/user_property.c
@@ -40,6 +40,7 @@ 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_end();
return -1;
}
@@ -52,6 +53,7 @@ main(int argc, char* argv[])
char s[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str((UChar* )s, r, &einfo);
fprintf(stderr, "onig_new: ERROR: %s\n", s);
+ onig_end();
return -1;
}
@@ -76,6 +78,9 @@ 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;
}