summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorAaron Lehmann2002-11-28 11:27:31 +0000
committerAaron Lehmann2002-11-28 11:27:31 +0000
commita170e1c858d35c474ceb9fecb41b37d681424094 (patch)
treecda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /shell/hush.c
parent1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff)
downloadbusybox-a170e1c858d35c474ceb9fecb41b37d681424094.zip
busybox-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz
Change if(x)free(x); to free(x);
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 08b3b29..48d1d14 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -810,7 +810,7 @@ static void b_reset(o_string *o)
static void b_free(o_string *o)
{
b_reset(o);
- if (o->data != NULL) free(o->data);
+ free(o->data);
o->data = NULL;
o->maxlen = 0;
}
@@ -880,8 +880,7 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str)
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
/* Set up the prompt */
if (promptmode == 1) {
- if (PS1)
- free(PS1);
+ free(PS1);
PS1=xmalloc(strlen(cwd)+4);
sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# ");
*prompt_str = PS1;