fs/romfs: One allocation was not being freed if there was a subsequent failure to allocation I/O buffers resulting in a memory leak on certain error conditions. From Bruno Herrera.

This commit is contained in:
Bruno Herrera 2015-08-30 18:31:58 -06:00 committed by Gregory Nutt
parent 3fd07e32e9
commit 915792cca1
2 changed files with 4 additions and 1 deletions

View File

@ -10905,4 +10905,6 @@
to protect and unprotect memory (2015-08-29).
* binfmt/builtin.c: Fix a memory leak: File was not being closed.
From Bruno Herrera (2015-08-30).
* fs/romfs: One allocation was not being freed if there was a
subsequent failure to allocation I/O buffers resulting in a memory
leak on certain error conditions. From Bruno Herrera (2015-08-30).

View File

@ -656,6 +656,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
ret = romfs_fileconfigure(rm, newrf);
if (ret < 0)
{
kmm_free(newrf);
fdbg("Failed configure buffering: %d\n", ret);
goto errout_with_semaphore;
}