mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
libc: Replace all malloc/free to lib_malloc/lib_free
since libc can be built and used in kernel space, we must call kmm_malloc and kmm_free in this case. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Abdelatif Guettouche
parent
d2f75467b5
commit
1cb1fb427d
@@ -30,6 +30,8 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "libc.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -62,7 +64,7 @@ FAR char *realpath(FAR const char *path, FAR char *resolved)
|
||||
|
||||
if (resolved == NULL)
|
||||
{
|
||||
fres = resolved = malloc(PATH_MAX);
|
||||
fres = resolved = lib_malloc(PATH_MAX);
|
||||
if (resolved == NULL)
|
||||
{
|
||||
return NULL;
|
||||
@@ -230,6 +232,6 @@ loop:
|
||||
goto loop;
|
||||
|
||||
out:
|
||||
free(fres);
|
||||
lib_free(fres);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user