[PATCH] IMFS: Resource leak

Gedare Bloom gedare at rtems.org
Thu Sep 5 15:55:50 UTC 2013


Free fs_info in case root_node is NULL.
---
 cpukit/libfs/src/imfs/imfs_initsupp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cpukit/libfs/src/imfs/imfs_initsupp.c b/cpukit/libfs/src/imfs/imfs_initsupp.c
index 1593076..7fe1e16 100644
--- a/cpukit/libfs/src/imfs/imfs_initsupp.c
+++ b/cpukit/libfs/src/imfs/imfs_initsupp.c
@@ -90,6 +90,7 @@ int IMFS_initialize_support(
       mt_entry->mt_fs_root->location.node_access = root_node;
       IMFS_Set_handlers( &mt_entry->mt_fs_root->location );
     } else {
+      free(fs_info);
       errno = ENOMEM;
       rv = -1;
     }
-- 
1.7.1




More information about the devel mailing list