memory leak in imfs?

Joel Sherrill joel.sherrill at oarcorp.com
Sun Apr 15 17:14:05 UTC 2007


shizheng wrote:
> Hi,
>
> When a symlink file of IMFS is created, IMFS_jnode_t->info.sym_link.name 
> is allocated
>  in IMFS_create_node function. But the memory isn't freed when 
> IMFS_rmnod is called.
>
> int IMFS_rmnod(
>   rtems_filesystem_location_info_t      *pathloc       /* IN */
> )
> {
>     ......
>   if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 
> 1) ) {
>      ......
>     /*
>      * Free memory associated with a memory file.
>      */
>     free( the_jnode );   /* here only the_jnode is freed, how about the 
> memory that hold the symlink name??*/
>   }
>   return 0;
> }
>   
Can you submit a test case and patch?  The test case should be fairly 
simple.

With the test case, it should be fairly simple to verify that memory 
isn't being
leaked by looking at the data structures for the heap.
 

--joel
> yours, shizheng
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list