Closed Bug 110666 Opened 23 years ago Closed 23 years ago

MimeInlineText leaks encoder and decoder

Categories

(MailNews Core :: MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: Bienvenu, Assigned: Bienvenu)

References

Details

(Keywords: memory-leak)

Attachments

(1 file)

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.
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.
Attached patch proposed fixSplinter Review
fix is to free up comptrs in the finalize method. Please review.
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+
QA Contact: esther → stephend
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 110701 has been marked as a duplicate of this bug. ***
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
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.

Attachment

General

Created:
Updated:
Size: