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 | |
| parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) | |
| download | busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.bz2 busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.zip | |
Change if(x)free(x); to free(x);
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/hush.c | 5 | ||||
| -rw-r--r-- | shell/lash.c | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/shell/hush.c b/shell/hush.c index 08b3b295f..48d1d1458 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
| @@ -810,7 +810,7 @@ static void b_reset(o_string *o) | |||
| 810 | static void b_free(o_string *o) | 810 | static void b_free(o_string *o) |
| 811 | { | 811 | { |
| 812 | b_reset(o); | 812 | b_reset(o); |
| 813 | if (o->data != NULL) free(o->data); | 813 | free(o->data); |
| 814 | o->data = NULL; | 814 | o->data = NULL; |
| 815 | o->maxlen = 0; | 815 | o->maxlen = 0; |
| 816 | } | 816 | } |
| @@ -880,8 +880,7 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str) | |||
| 880 | #ifndef CONFIG_FEATURE_SH_FANCY_PROMPT | 880 | #ifndef CONFIG_FEATURE_SH_FANCY_PROMPT |
| 881 | /* Set up the prompt */ | 881 | /* Set up the prompt */ |
| 882 | if (promptmode == 1) { | 882 | if (promptmode == 1) { |
| 883 | if (PS1) | 883 | free(PS1); |
| 884 | free(PS1); | ||
| 885 | PS1=xmalloc(strlen(cwd)+4); | 884 | PS1=xmalloc(strlen(cwd)+4); |
| 886 | sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); | 885 | sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); |
| 887 | *prompt_str = PS1; | 886 | *prompt_str = PS1; |
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) | |||
| 518 | if (cmd->progs[i].redirects) | 518 | if (cmd->progs[i].redirects) |
| 519 | free(cmd->progs[i].redirects); | 519 | free(cmd->progs[i].redirects); |
| 520 | } | 520 | } |
| 521 | if (cmd->progs) | 521 | free(cmd->progs); |
| 522 | free(cmd->progs); | 522 | free(cmd->text); |
| 523 | if (cmd->text) | 523 | free(cmd->cmdbuf); |
| 524 | free(cmd->text); | ||
| 525 | if (cmd->cmdbuf) | ||
| 526 | free(cmd->cmdbuf); | ||
| 527 | keep = cmd->job_list; | 524 | keep = cmd->job_list; |
| 528 | memset(cmd, 0, sizeof(struct job)); | 525 | memset(cmd, 0, sizeof(struct job)); |
| 529 | cmd->job_list = keep; | 526 | cmd->job_list = keep; |
| @@ -677,8 +674,7 @@ static inline void setup_prompt_string(char **prompt_str) | |||
| 677 | #ifndef CONFIG_FEATURE_SH_FANCY_PROMPT | 674 | #ifndef CONFIG_FEATURE_SH_FANCY_PROMPT |
| 678 | /* Set up the prompt */ | 675 | /* Set up the prompt */ |
| 679 | if (shell_context == 0) { | 676 | if (shell_context == 0) { |
| 680 | if (PS1) | 677 | free(PS1); |
| 681 | free(PS1); | ||
| 682 | PS1=xmalloc(strlen(cwd)+4); | 678 | PS1=xmalloc(strlen(cwd)+4); |
| 683 | sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); | 679 | sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); |
| 684 | *prompt_str = PS1; | 680 | *prompt_str = PS1; |
