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

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Apr 30 01:43:09 PDT 2020


commit 7f6b3b895fe65da40bd61ad01ac14f9194076ddd
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/7f6b3b895fe65da40bd61ad01ac14f9194076ddd


-- 
DragonFly BSD source repository


More information about the Commits mailing list