elf-core: Plug latent memory leak
authorEd Maste <emaste@freebsd.org>
Sun, 16 Feb 2014 04:01:54 +0000 (04:01 +0000)
committerEd Maste <emaste@freebsd.org>
Sun, 16 Feb 2014 04:01:54 +0000 (04:01 +0000)
commitff8e5f2587145bdd2f4194ab0472889933ee4fb0
tree625ff69c54c475f2ff7516c37113a02f07914e76
parent53d8b200784b289c859efd40681038da4c11a777
elf-core: Plug latent memory leak

ProcessElfCore::ParseThreadContextsFromNoteSegment was leaking
ThreadData for each ELF note found in core file.  We now allocate it
only once and use std::unique_ptr to ensure it is always being freed.

While at it make ParseFreeBSDThrMisc and ParseFreeBSDPrStatus take
ThreadData by reference, rather than pointer, since those arguments are
not optional.

Patch by Piotr Rak.

http://llvm-reviews.chandlerc.com/D2813

llvm-svn: 201473
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp