A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Express Email Newsgroup » Outlook Express
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Memory leak bug in inetcomm!CreateNewsHeader?



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 3rd 09, 05:56 AM posted to microsoft.public.windows.inetexplorer.ie6_outlookexpress
oen
external usenet poster
 
Posts: 2
Default Memory leak bug in inetcomm!CreateNewsHeader?

OE uses inetcomm.dll(6.0.2900.5512) to create the news header, when I tried to interpret the disassemble codes as C codes, I found that INETCOMM!CreateNewsHeader calls INETCOMM!EscapePound to MemAlloc a LPWSTR (if needed), and uses the returned LPWSTR in eax, but at last, does not call ole32!CRetailMalloc_Free to free the LPWSTR! Is this a Memory leak bug?

HRESULT _stdcall CreateNewsHeader(IMimeMessageTree *pMTree, DWORD ReplyFlags, IVirtualStream *pVStream) {
DWORD countByte; //used as esi
WCHAR *pMessageIDEscapePound; //used as eax
WCHAR *pFormtString = 0; //ebp-404h
HRESULT hr; //ebp-408h
WCHAR *pAddress = 0; //ebp-40Ch
WCHAR *pMessageID = 0; //ebp-410h
WCHAR *pMessageIDDropAngles = 0; //ebp-414h
WCHAR *pNewsHeader = 0; //ebp-418h
WCHAR *pNewsHeaderHtml; //ebp-420h

pMTree-GetAddressFormatW(IAT_FROM, AFT_DISPLAY_BOTH, &pAddress);
MimeOleGetBodyPropW(pMTree, HBODY_ROOT, PID_HDR_MESSAGEID, 0, &pMessageID);
countByte = 2 * LoadStringWrapW(hModuleInetresDll, 1167, &pFormtString, 512);
if (pAddress) {
countByte += 2 * lstrlenW(pAddress);
else
pAddress = g_wszEmpty;
if (pMessageID) {
if (pMessageIDEscapePound = EscapePound(pMessageID)) {
DropAngles(pMessageIDEscapePound, &pMessageIDDropAngles);
else
DropAngles(pMessageID, &pMessageIDDropAngles);
countByte += 2 * lstrlenW(pMessageIDDropAngles);
} else
pMessageIDDropAngles = g_wszEmpty;
countByte += 2;
if (S_OK != MemAlloc(&pNewsHeader, countByte)) {
hr = MAKE_SCODE(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OUTOFMEMORY);
goto epilog;
}
if (S_OK != (hr = pVStream-Write(L"DIV", 2 * lstrlenW(L"DIV"), NULL)))
goto epilog;
wnsprintfW(pNewsHeader, countByte, pFormtString, pAddress, pMessageIDDropAngles);
if (S_OK != (hr = EscapeStringToHTML(pNewsHeader, &pNewsHeaderHtml)))
goto epilog;
pVStream-Write(pNewsHeaderHtml, 2 * lstrlenW(pNewsHeaderHtml), NULL); //why not check hr?
RetailMalloc_Free(pNewsHeaderHtml);
hr = pVStream-Write(L"/DIV", 2 * lstrlenW(L"/DIV"), NULL);
epilog:
if (pAddress != g_wszEmpty)
RetailMalloc_Free(pAddress);
RetailMalloc_Free(pMessageID);
RetailMalloc_Free(pNewsHeader);
//no RetailMalloc_Free(pMessageIDEscapePound)!
return hr;
}


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IExchExt interface leak JahMic Add-ins for Outlook 0 February 7th 08 10:32 AM
Outlook 2003 very slow after installing on vista, memory leak? [email protected] Outlook - Installation 1 February 19th 07 02:35 PM
2 GB of memory over 1 GB of memory free, and outlook complains of being out of memory David Hettel Outlook Express 7 October 18th 06 12:08 PM
How to over coem Memory Leak and code optimization for outlook Virda Outlook and VBA 1 September 21st 06 06:24 AM
LoadLibrary failed with inetcomm.dll Patrick E. King Outlook Express 2 June 20th 06 11:42 AM


All times are GMT +1. The time now is 04:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.