summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-09-28 22:07:23 +0000
committerDenis Vlasenko2007-09-28 22:07:23 +0000
commit6081868ee33c44f5a7227b77876d7e7a83c8aa9e (patch)
tree15efd13947c3a22f640168e535b694d318be9704 /shell/ash.c
parente918e155ed1d36522e0c096e43d275f1ebda0515 (diff)
downloadbusybox-6081868ee33c44f5a7227b77876d7e7a83c8aa9e.zip
busybox-6081868ee33c44f5a7227b77876d7e7a83c8aa9e.tar.gz
fix "if (p) free(p)" constructs
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c
index a3bfe39..183911c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5328,8 +5328,7 @@ expbackq(union node *cmd, int quoted, int quotes)
p = buf;
}
- if (in.buf)
- free(in.buf);
+ free(in.buf);
if (in.fd >= 0) {
close(in.fd);
back_exitstatus = waitforjob(in.jp);
@@ -8788,8 +8787,7 @@ popfile(void)
INT_OFF;
if (pf->fd >= 0)
close(pf->fd);
- if (pf->buf)
- free(pf->buf);
+ free(pf->buf);
while (pf->strpush)
popstring();
parsefile = pf->prev;
@@ -10330,8 +10328,7 @@ parsebackq: {
#endif
savepbq = parsebackquote;
if (setjmp(jmploc.loc)) {
- if (str)
- free(str);
+ free(str);
parsebackquote = 0;
exception_handler = savehandler;
longjmp(exception_handler->loc, 1);
@@ -11264,8 +11261,7 @@ trapcmd(int argc, char **argv)
else
action = ckstrdup(action);
}
- if (trap[signo])
- free(trap[signo]);
+ free(trap[signo]);
trap[signo] = action;
if (signo != 0)
setsignal(signo);