From 029c1fd8e306a3374882142e3ccc4a75934b4c28 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 16 Apr 2007 19:04:47 +0000 Subject: [PATCH] 2007-04-16 Joel Sherrill PR 1240/filesystem * libfs/src/imfs/imfs_rmnod.c: Fix link when removing a symlink. Memory for filename was not being freed. --- cpukit/ChangeLog | 6 ++++++ cpukit/libfs/src/imfs/imfs_rmnod.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index bb398bfb90..74a2920ee9 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2007-04-16 Joel Sherrill + + PR 1240/filesystem + * libfs/src/imfs/imfs_rmnod.c: Fix link when removing a symlink. Memory + for filename was not being freed. + 2007-04-16 Ralf Corsépius * pppd/utils.c: Use uintptr_t instead of unsigned long. diff --git a/cpukit/libfs/src/imfs/imfs_rmnod.c b/cpukit/libfs/src/imfs/imfs_rmnod.c index d5e32378ad..f37cb6d23c 100644 --- a/cpukit/libfs/src/imfs/imfs_rmnod.c +++ b/cpukit/libfs/src/imfs/imfs_rmnod.c @@ -71,6 +71,10 @@ int IMFS_rmnod( * Free memory associated with a memory file. */ + if ( the_jnode->type == IMFS_SYM_LINK ) { + if ( the_jnode->info.sym_link.name ) + free( the_jnode->info.sym_link.name ); + } free( the_jnode ); }