Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fs/inode/fs_inodesearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static int _inode_search(FAR struct inode_search_s *desc)
buflen = PATH_MAX;
}

desc->buffer = lib_get_tempbuffer(buflen);
desc->buffer = fs_heap_malloc(buflen);
if (desc->buffer == NULL)
{
return -ENOMEM;
Expand Down Expand Up @@ -578,7 +578,7 @@ static int _inode_search(FAR struct inode_search_s *desc)
{
FAR char *buffer = NULL;

buffer = lib_get_tempbuffer(PATH_MAX);
buffer = fs_heap_malloc(PATH_MAX);
if (buffer == NULL)
{
ret = -ENOMEM;
Expand All @@ -587,7 +587,7 @@ static int _inode_search(FAR struct inode_search_s *desc)
{
snprintf(buffer, PATH_MAX, "%s/%s",
desc->relpath, name);
lib_put_tempbuffer(desc->buffer);
fs_heap_free(desc->buffer);
desc->buffer = buffer;
relpath = buffer;
ret = OK;
Expand Down
4 changes: 3 additions & 1 deletion fs/inode/inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
#include <nuttx/fs/fs.h>
#include <nuttx/lib/lib.h>

#include "fs_heap.h"

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand All @@ -63,7 +65,7 @@
{ \
if ((d)->buffer != NULL) \
{ \
lib_put_tempbuffer((d)->buffer); \
fs_heap_free((d)->buffer); \
(d)->buffer = NULL; \
} \
} \
Expand Down
4 changes: 2 additions & 2 deletions include/nuttx/lib/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ void lib_put_tempbuffer(FAR char *buffer);
# define lib_put_tempbuffer(b)
#endif

#define lib_get_pathbuffer() lib_get_tempbuffer(PATH_MAX)
#define lib_put_pathbuffer(b) lib_put_tempbuffer(b)
#define lib_get_pathbuffer() lib_malloc(PATH_MAX)
#define lib_put_pathbuffer(b) lib_free(b)

/* Functions defined in lib_realpath.c **************************************/

Expand Down
Loading