From 88917b0f143e2eac468aea14338b4d9eddba389d Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 20 May 2008 20:39:38 +0000 Subject: replace "if (p) free(p)" by just "free(p)" - free(NULL) is safe. --- libc/unistd/usershell.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'libc/unistd') diff --git a/libc/unistd/usershell.c b/libc/unistd/usershell.c index ea4a04ba4..4a9ba0bca 100644 --- a/libc/unistd/usershell.c +++ b/libc/unistd/usershell.c @@ -80,13 +80,9 @@ char * getusershell(void) static void __free_initshell_memory(void) { - if (shells != NULL) { - free(shells); - } + free(shells); shells = NULL; - if (strings != NULL) { - free(strings); - } + free(strings); strings = NULL; } @@ -98,7 +94,6 @@ void endusershell(void) void setusershell(void) { - curshell = initshells(); } -- cgit v1.2.3