MimeInlineText leaks encoder and decoder

VERIFIED FIXED

Status

MailNews Core
MIME
VERIFIED FIXED
17 years ago
10 years ago

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Tracking

({memory-leak})

Trunk
memory-leak

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

565 bytes, patch
Jean-Francois Ducarroz
: review+
(not reading, please use seth@sspitzer.org instead)
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

17 years ago
MimeInlineText has a couple com ptrs as member variables. These don't get
released, because MimeInlineText is a struct, not a class, and thus doesn't have
a destructor. The simple fix is to make it a class, which I'll try.
(Assignee)

Comment 1

17 years ago
I also looked through the rest of libmime for similar mistakes and found one in
mime_draft_data which has an nsCOMPtr <nsIMsgIdentity> which is never freed.
(Assignee)

Comment 2

17 years ago
Created attachment 58288 [details] [diff] [review]
proposed fix

fix is to free up comptrs in the finalize method. Please review.
(Assignee)

Comment 3

17 years ago
this leaks on every message we read.
Status: NEW → ASSIGNED
Keywords: mlk, nsbeta1+
Comment on attachment 58288 [details] [diff] [review]
proposed fix

sr=sspitzer

you leak finding (and killing) monster!
Attachment #58288 - Flags: superreview+
Comment on attachment 58288 [details] [diff] [review]
proposed fix

R=ducarroz
Attachment #58288 - Flags: review+

Updated

17 years ago
QA Contact: esther → stephend
(Assignee)

Comment 6

17 years ago
fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Assignee)

Comment 8

17 years ago
*** Bug 110701 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 9

17 years ago
no, my fix is simpler.
Different bug?

[W] MLK: Memory leak of 1 byte from 1 block allocated in PL_strdup
        Distribution of leaked blocks
        Allocation location
            malloc         [msvcrt.DLL]
            PL_strdup      [strdup.c:46]
            nsPrefService::GetCharPref(char const*,char * *) 
[nsPrefService.h:57]
            MimeInlineTextPlain_parse_begin [mimetpla.cpp:165]
            MimeUntypedText_open_subpart [mimeunty.cpp:369]
            MimeUntypedText_parse_line [mimeunty.cpp:183]
            convert_and_send_buffer [mimebuf.cpp:168]
            mime_LineBuffer [mimebuf.cpp:255]
            MimeObject_parse_buffer [mimeobj.cpp:255]
            convert_and_send_buffer [mimebuf.cpp:168]
            mime_LineBuffer [mimebuf.cpp:255]
            MimeObject_parse_buffer [mimeobj.cpp:255]
            nsStreamConverter::OnDataAvailable(nsIRequest *,nsISupports 
*,nsIInputStream *,UINT,UINT) [nsStreamConverter.cpp:919]
            nsDocumentOpenInfo::OnDataAvailable(nsIRequest *,nsISupports 
*,nsIInputStream *,UINT,UINT) [nsURILoader.cpp:240]
            nsStreamListenerTee::OnDataAvailable(nsIRequest *,nsISupports 
*,nsIInputStream *,UINT,UINT) [nsStreamListenerTee.cpp:56]
            nsOnDataAvailableEvent0::HandleEvent(void) 
[nsAsyncStreamListener.cpp:426]
            nsStreamListenerEvent0::HandlePLEvent(PLEvent *) 
[nsAsyncStreamListener.cpp:113]
            md_EventReceiverProc [plevent.c:1071]
            ScrollDC       [user32.dll]
            ScrollDC       [user32.dll]
Well, the other 2 mime leaks are fixed, so I'll let this bug stay in scope by
verifying it, and I'll file the new bug (along with steps to reproduce).

Win2k, current trunk CVS pull with Purify.
Status: RESOLVED → VERIFIED
(Assignee)

Comment 12

17 years ago
yeah, Stephen, that's a different leak. You can assign the new one to me and cc JF.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.