git: libc - Fix a serious memory leak in the nmalloc code

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Apr 30 01:41:51 PDT 2020


commit 064bf225823454be0c9f72ddfca7f7c6cc209cd5
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Apr 30 01:39:05 2020 -0700

    libc - Fix a serious memory leak in the nmalloc code
    
    * Fix a bug where mtmagazine_free() would assign mt->newmag without
      re-checking its contents, potentially overwriting an assignment
      made by _slaballoc(), causing a memory leak.
    
    * This bug generally rears its ugly head in heavily pthreaded programs,
      but it can occur under other conditions too.
    
    Reported-by: hsw (irc)

Summary of changes:
 lib/libc/stdlib/nmalloc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/064bf225823454be0c9f72ddfca7f7c6cc209cd5


-- 
DragonFly BSD source repository



More information about the Commits mailing list