diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-10 00:24:24 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-10 00:24:24 -0800 |
| commit | f4a7b80b4ff63d6610142b417cbadd6526339ae4 (patch) | |
| tree | 1da87124f2fa4b935aa17eb25da100475ae49ff3 /compiler.c | |
| parent | 9d1f51c483578c66d401a59f59ad18add0e1a52f (diff) | |
Updated more things to use xfree(&foo) instead of free(foo)
Diffstat (limited to 'compiler.c')
| -rw-r--r-- | compiler.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -351,7 +351,7 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) // Parentheses case '(': case '{': { char closing = c == '(' ? ')' : '}'; - free(op); + xfree(&op); op = bp_simplepattern(f, str); if (!op) file_err(f, str, str, "There should be a valid pattern after this parenthesis."); @@ -428,8 +428,8 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) op->args.s = strndup(&c, 1); } if (matchchar(&str, ':')) { // Don't match definitions - free((char*)op->args.s); - free(op); + xfree(&op->args.s); + xfree(&op); return NULL; } op->op = VM_REF; @@ -442,14 +442,14 @@ vm_op_t *bp_simplepattern(file_t *f, const char *str) const char *refname = str; str = after_name(str); if (matchchar(&str, ':')) { // Don't match definitions - free(op); + xfree(&op); return NULL; } op->op = VM_REF; op->args.s = strndup(refname, (size_t)(str - refname)); break; } else { - free(op); + xfree(&op); return NULL; } } @@ -535,8 +535,7 @@ vm_op_t *bp_stringpattern(file_t *f, const char *str) strop->end = str; if (strop->len == 0) { - free(strop); - strop = NULL; + xfree(&strop); } else { ret = chain_together(ret, strop); } |
