summaryrefslogtreecommitdiffstats
path: root/nuttx/sched/env_putenv.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/env_putenv.c')
-rw-r--r--nuttx/sched/env_putenv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/nuttx/sched/env_putenv.c b/nuttx/sched/env_putenv.c
index 43ca44d4d5..65c3d4c032 100644
--- a/nuttx/sched/env_putenv.c
+++ b/nuttx/sched/env_putenv.c
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/env_putenv.c
*
- * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -43,9 +43,10 @@
#include <sched.h>
#include <string.h>
-#include <stdlib.h>
#include <errno.h>
+#include <nuttx/kmalloc.h>
+
/****************************************************************************
* Private Data
****************************************************************************/
@@ -106,11 +107,12 @@ int putenv(FAR const char *string)
*pequal = '\0';
ret = setenv(pname, pequal+1, TRUE);
}
- free(pname);
+
+ kfree(pname);
return ret;
errout:
- *get_errno_ptr() = ret;
+ errno = ret;
return ERROR;
}