[haiku-bugs] Re: [Haiku] #9909: [kernel/fs] vfs.cpp: Memory leak

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Thu, 01 Aug 2013 13:54:42 -0000

#9909: [kernel/fs] vfs.cpp: Memory leak
-----------------------------+----------------------------
   Reporter:  mt             |      Owner:  axeld
       Type:  bug            |     Status:  closed
   Priority:  normal         |  Milestone:  R1
  Component:  System/Kernel  |    Version:  R1/Development
 Resolution:  fixed          |   Keywords:  kernel/fs
 Blocked By:                 |   Blocking:
Has a Patch:  1              |   Platform:  All
-----------------------------+----------------------------
Changes (by bonefish):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 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!

--
Ticket URL: <http://dev.haiku-os.org/ticket/9909#comment:2>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: