summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorroot2009-05-04 12:00:19 +0200
committerroot2009-05-04 12:00:19 +0200
commit6245202e7fc76992b838613a1c2bde79387a28c0 (patch)
tree375ceb769b6e1d373b67963220aa20afd22fc200 /shell
parent62851171db373fc24784357dc986c28058b68edf (diff)
downloadbusybox-6245202e7fc76992b838613a1c2bde79387a28c0.zip
busybox-6245202e7fc76992b838613a1c2bde79387a28c0.tar.gz
hush: small fix for unset -f on NOMMU.
Signed-off-by: root <root@localhost.localdomain>
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/shell/hush.c b/shell/hush.c
index d1f674e..370e0d7 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2924,13 +2924,13 @@ static void unset_func(const char *name)
while ((funcp = *funcpp) != NULL) {
if (strcmp(funcp->name, name) == 0) {
*funcpp = funcp->next;
- /* funcp is unlinked now, deleting it */
- free(funcp->name);
- /* Note: if !funcp->body, do not free body_as_string!
- * This is a special case of "-F name body" function:
- * body_as_string was not malloced! */
+ /* funcp is unlinked now, deleting it.
+ * Note: if !funcp->body, the function was created by
+ * "-F name body", do not free ->body_as_string
+ * and ->name as they were not malloced. */
if (funcp->body) {
free_pipe_list(funcp->body);
+ free(funcp->name);
# if !BB_MMU
free(funcp->body_as_string);
# endif