Opened 11 years ago
Closed 11 years ago
#9909 closed bug (fixed)
[kernel/fs] vfs.cpp: Memory leak
Reported by: | mt | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/Kernel | Version: | R1/Development |
Keywords: | kernel/fs | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
In get_file_system(), if strncmp() returns non-zero, then memory pointed by fsName is leaked, which causes memory leak in fs_mount().
Attachments (2)
Change History (4)
by , 11 years ago
Attachment: | 0020-Fix-memory-leak.patch added |
---|
comment:1 by , 11 years ago
patch: | 0 → 1 |
---|
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Your patch doesn't fix the issue. get_file_system()
doesn't free or take ownership of the specified name in either case, nor is it supposed to do so. The leak is in the loop in fs_mount()
-- the name simply needs to be freed after the iteration. The free()
was just missing in the success case. Fixed in hrev45939. Instead of adding another free()
, I removed the existing ones and used a MemoryDeleter
, though.
At any rate, thanks for the analysis!
Patch