mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2003-06-10 Phil Torre <ptorre@zetron.com>
PR 411/filesystem * src/imfs/imfs_unlink.c: Fix bug where renaming a memfile and then unlinking it causes a memory leak.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2003-06-10 Phil Torre <ptorre@zetron.com>
|
||||
|
||||
PR 411/filesystem
|
||||
* src/imfs/imfs_unlink.c: Fix bug where renaming a memfile and
|
||||
then unlinking it causes a memory leak.
|
||||
|
||||
2003-03-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
|
||||
|
||||
PR 367/filesystem
|
||||
|
||||
@@ -58,12 +58,16 @@ int IMFS_unlink(
|
||||
* to remove the node that is a link and the node itself.
|
||||
*/
|
||||
|
||||
node->info.hard_link.link_node->st_nlink --;
|
||||
IMFS_update_ctime( node->info.hard_link.link_node );
|
||||
if ( node->info.hard_link.link_node->st_nlink < 1) {
|
||||
result = (*the_link.handlers->rmnod_h)( &the_link );
|
||||
if ( result != 0 )
|
||||
return -1;
|
||||
if ( node->info.hard_link.link_node->st_nlink == 1)
|
||||
{
|
||||
result = (*the_link.handlers->rmnod_h)( &the_link );
|
||||
if ( result != 0 )
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
node->info.hard_link.link_node->st_nlink --;
|
||||
IMFS_update_ctime( node->info.hard_link.link_node );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user