diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
commit | a170e1c858d35c474ceb9fecb41b37d681424094 (patch) | |
tree | cda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /shell/lash.c | |
parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) |
Change if(x)free(x); to free(x);
Diffstat (limited to 'shell/lash.c')
-rw-r--r-- | shell/lash.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/shell/lash.c b/shell/lash.c index 7994d2620..c4d6ef04e 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -518,12 +518,9 @@ static void free_job(struct job *cmd) if (cmd->progs[i].redirects) free(cmd->progs[i].redirects); } - if (cmd->progs) - free(cmd->progs); - if (cmd->text) - free(cmd->text); - if (cmd->cmdbuf) - free(cmd->cmdbuf); + free(cmd->progs); + free(cmd->text); + free(cmd->cmdbuf); keep = cmd->job_list; memset(cmd, 0, sizeof(struct job)); cmd->job_list = keep; @@ -677,8 +674,7 @@ static inline void setup_prompt_string(char **prompt_str) #ifndef CONFIG_FEATURE_SH_FANCY_PROMPT /* Set up the prompt */ if (shell_context == 0) { - if (PS1) - free(PS1); + free(PS1); PS1=xmalloc(strlen(cwd)+4); sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); *prompt_str = PS1; |