TMPFS: Fix a memory leak
This commit is contained in:
parent
838f9e5a18
commit
6a2098d35c
|
@ -974,6 +974,7 @@ static int tmpfs_find_object(FAR struct tmpfs_s *fs,
|
||||||
{
|
{
|
||||||
/* No object with this name exists in the directory. */
|
/* No object with this name exists in the directory. */
|
||||||
|
|
||||||
|
kmm_free(copy);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -993,10 +994,11 @@ static int tmpfs_find_object(FAR struct tmpfs_s *fs,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No, this was not the final segement of the relpath.
|
/* No, this was not the final segement of the relpath.
|
||||||
* We cannot continue the search if any of the intermidate
|
* We cannot continue the search if any of the intermediate
|
||||||
* segements do no correspond to directories.
|
* segments do no correspond to directories.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
kmm_free(copy);
|
||||||
return -ENOTDIR;
|
return -ENOTDIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue