namjaejeon / ntfsprogs-plus

NTFS filesystem userspace utilities
GNU General Public License v2.0
10 stars 5 forks source link

libntfs-3g: fix cache memory leak #93

Closed jaysim closed 1 year ago

jaysim commented 1 year ago

when using inode cache(nidata cache) and openning multiple same inode, it may have the potential to memory leak, and it can lead to corruption.

first calling ntfs_inode_close() will put inode to cache, but second calling ntfs_inode_close() will not anything. memory leak occurred here.

when second calling ntfs_inode_close(), ie, already inode is in cache, should call do_free() which is registered in cache initialization.

namjaejeon commented 1 year ago

Applied, Thanks!