Closed Bug 112342 Opened 23 years ago Closed 23 years ago

Memory leak of 23 bytes from 1 block allocated in MimeHeaders_get_name

Categories

(MailNews Core :: MIME, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: naving)

References

()

Details

(Keywords: memory-leak)

Attachments

(1 file)

Build: Latest trunk pull @8:45 pm using Windows 2000 / Purify. Summary: Memory leak of 23 bytes from 1 block allocated in MimeHeaders_get_name Steps to Reproduce: Reading an inline JPG attachment around 180 lines inside a newsgroup, I get: [W] MLK: Memory leak of 23 bytes from 1 block allocated in PR_Malloc Distribution of leaked blocks Allocation location malloc [msvcrt.DLL] PR_Malloc [prmem.c:50] MimeHeaders_get_name(MimeHeaders *,MimeDisplayOptions *) [mimehdrs.cpp:875] s = MimeHeaders_get(hdrs, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE); if (s) { => name = MimeHeaders_get_parameter(s, HEADER_PARM_FILENAME, &charset, NULL); PR_Free(s); } MimeInlineImage_parse_begin [mimeiimg.cpp:132] nsCAutoString url_with_filename(image_url); url_with_filename += "&type="; url_with_filename += ct; => char * filename = MimeHeaders_get_name ( obj->headers, obj->options ); if (filename) { char *escapedName = nsEscape(filename, url_Path); MimeUntypedText_open_subpart [mimeunty.cpp:369] } /* And start its parser going. */ => status = uty->open_subpart->clazz->parse_begin(uty->open_subpart); if (status < 0) { /* MimeContainer->finalize will take care of shutting it down now. */ MimeUntypedText_parse_line [mimeunty.cpp:150] status = MimeUntypedText_open_subpart (obj, MimeUntypedTextSubpartTypeUUE, type, ENCODING_UUENCODE, => name, NULL); PR_FREEIF(name); PR_FREEIF(type); if (status < 0) return status; convert_and_send_buffer [mimebuf.cpp:168] } #endif => return (*per_line_fn)(buf, length, closure); } extern "C" int mime_LineBuffer [mimebuf.cpp:255] status = convert_and_send_buffer(*bufferP, *buffer_fpP, convert_newlines_p, => per_line_fn, closure); if (status < 0) return status; MimeObject_parse_buffer [mimeobj.cpp:255] ((int (*PR_CALLBACK) (char *, PRInt32, void *)) /* This cast is to turn void into MimeObject */ obj->clazz->parse_line), => obj); } convert_and_send_buffer [mimebuf.cpp:168] } #endif => return (*per_line_fn)(buf, length, closure); } extern "C" int mime_LineBuffer [mimebuf.cpp:255] status = convert_and_send_buffer(*bufferP, *buffer_fpP, convert_newlines_p, => per_line_fn, closure); if (status < 0) return status; MimeObject_parse_buffer [mimeobj.cpp:255] ((int (*PR_CALLBACK) (char *, PRInt32, void *)) /* This cast is to turn void into MimeObject */ obj->clazz->parse_line), => obj); } nsStreamConverter::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,UINT,UINT) [nsStreamConverter.cpp:919] else if (mBridgeStream) { nsMIMESession *tSession = (nsMIMESession *) mBridgeStream; => rc = tSession->put_block((nsMIMESession *)mBridgeStream, buf, readLen); } PR_FREEIF(buf); nsDocumentOpenInfo::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,UINT,UINT) [nsURILoader.cpp:240] nsNntpCacheStreamListener::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,UINT,UINT) [nsNNTPProtocol.cpp:747] nsStorageTransport::nsReadRequest::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream *,UINT,UINT) [nsStorageTransport.cpp:625] XPTC_InvokeByIndex [xptcinvoke.cpp:152] EventHandler [nsProxyEvent.cpp:514] md_EventReceiverProc [plevent.c:1071] ScrollDC [user32.dll]
See my test post at news://news.mcom.com/netscape.public.test entitled, "Testing leaks, ignore this". Man, I sure hope this isnt' a DUP.
taking, I don't think it is a dupe.
Assignee: ducarroz → naving
QA Contact: esther → stephend
Attached patch proposed fixSplinter Review
free filename. please review.
Comment on attachment 59588 [details] [diff] [review] proposed fix R=ducarroz
Attachment #59588 - Flags: review+
david, looking for sr.
Comment on attachment 59588 [details] [diff] [review] proposed fix sr=bienvenu
Attachment #59588 - Flags: superreview+
fixed
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified FIXED... latest trunk Win32 build using Purify.
Status: RESOLVED → VERIFIED
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

Creator:
Created:
Updated:
Size: