From a170e1c858d35c474ceb9fecb41b37d681424094 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Thu, 28 Nov 2002 11:27:31 +0000 Subject: Change if(x)free(x); to free(x); --- editors/awk.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'editors/awk.c') diff --git a/editors/awk.c b/editors/awk.c index aea852b0d..44c2f45b2 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -650,7 +650,7 @@ static void clear_array(xhash *array) { while (hi) { thi = hi; hi = hi->next; - if (thi->data.v.string) free(thi->data.v.string); + free(thi->data.v.string); free(thi); } array->items[i] = NULL; @@ -661,7 +661,7 @@ static void clear_array(xhash *array) { /* clear a variable */ static var *clrvar(var *v) { - if (v->string && !(v->type & VF_FSTR)) + if (!(v->type & VF_FSTR)) free(v->string); v->type &= VF_DONTTOUCH; @@ -1504,7 +1504,7 @@ static void split_f0(void) { return; is_f0_split = TRUE; - if (fstrings) free(fstrings); + free(fstrings); fsrealloc(0); n = awk_split(getvar_s(V[F0]), &fsplitter.n, &fstrings); fsrealloc(n); @@ -2376,8 +2376,7 @@ re_cont: X.rsm = (rstream *)hash_search(fdhash, L.s); if (X.rsm) { R.i = X.rsm->is_pipe ? pclose(X.rsm->F) : fclose(X.rsm->F); - if (X.rsm->buffer) - free(X.rsm->buffer); + free(X.rsm->buffer); hash_remove(fdhash, L.s); } if (R.i != 0) -- cgit v1.2.3