Closed Bug 1142664 Opened 10 years ago Closed 10 years ago

[elfhack] Potential leak in ElfStrtab_Section

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: erahm, Unassigned)

Details

(Keywords: coverity, Whiteboard: [CID 1274481])

Coverity is noting a leak in |table_storage| due to it not allocating memory in it's constructor [1] but not having a destructor. Note that the |ElfStrtab_Section| dtor _does_ clean up some of the memory [2], but it starts at |begin() + 1|, skipping the first entry. It's possible the memory is cleaned up elsewhere, but a quick visual inspection does not indicate that is the case. [1] https://hg.mozilla.org/mozilla-central/annotate/0190a1d17294/build/unix/elfhack/elfxx.h#l631 [2] https://hg.mozilla.org/mozilla-central/annotate/0190a1d17294/build/unix/elfhack/elfxx.h#l612
I guess that's where coverity is outsmarted by code. As you'll note, the first item initialized with the other table_storage constructor, while all the others are initialized with the one you point. Which means the first item is always not an allocation and the others are. Which makes the ElfStrtab_Section dtor do the right thing. Also note elfhack is a build tool, not something that's part of Firefox and that would affect Firefox's memory use in any way.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Whiteboard: [MemShrink][CID 1274481] → [CID 1274481]
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.