diff --git a/ChangeLog b/ChangeLog index 6f6479b67b..16ea59458f 100755 --- a/ChangeLog +++ b/ChangeLog @@ -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). diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 3a65adfc2b..14c68ef7e8 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -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; }