Closed Bug 131383 Opened 24 years ago Closed 22 years ago

Memory leak of 63 bytes from 1 block allocated in nsBookmarksService::LoadBookmarks(void)

Categories

(SeaMonkey :: Bookmarks & History, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 191783
mozilla1.2alpha

People

(Reporter: stephend, Assigned: bugs)

Details

(Keywords: memory-leak, regression)

Latest trunk (as of 8 pm PST) on Windows 2000. Just starting browser with http://home.netscape.com as my homepage. [W] MLK: Memory leak of 63 bytes from 1 block allocated in nsBookmarksService::LoadBookmarks(void) Distribution of leaked blocks 63 bytes from 1 block of 63 bytes (0x097d8de8) Allocation location mbsdup [MSVCRT.DLL] nsBookmarksService::LoadBookmarks(void) [nsBookmarksService.cpp:4803] #endif if (constSystemBookmarksURL) => systemBookmarksURL = strdup(constSystemBookmarksURL); #endif if (useDynamicSystemBookmarks) nsBookmarksService::ReadBookmarks(int *) [nsBookmarksService.cpp:4690] nsBookmarksService::ReadBookmarks(PRBool *didLoadBookmarks) { if (!gLoadedBookmarks) { => LoadBookmarks(); gLoadedBookmarks = PR_TRUE; *didLoadBookmarks = PR_TRUE; } else { XPTC_InvokeByIndex [xptcinvoke.cpp:105] XPCWrappedNative::CallMethod (XPCCallContext&,CallMode::XPCWrappedNative) [xpcwrappednative.cpp:2025] XPC_WN_CallMethod(JSContext *,JSObject *,UINT,long *,long *) [xpcwrappednativejsops.cpp:1266] js_Invoke [jsinterp.c:788] js_Interpret [jsinterp.c:2745] js_Invoke [jsinterp.c:805] js_InternalInvoke [jsinterp.c:880] JS_CallFunctionValue [jsapi.c:3412] nsJSContext::CallEventHandler(void *,void *,UINT,void *,int *,int) [nsJSEnvironment.cpp:1016] GlobalWindowImpl::RunTimeout(nsTimeoutImpl *) [nsGlobalWindow.cpp:4121] GlobalWindowImpl::TimerCallback(nsITimer *,void *) [nsGlobalWindow.cpp:4434] ??? [ip=0x096f6638] nsTimerImpl::Process(void) [nsTimerImpl.cpp:329] handleMyEvent(MyEventType *) [nsTimerImpl.cpp:370] PL_HandleEvent [plevent.c:590] PL_ProcessPendingEvents [plevent.c:520] md_EventReceiverProc [plevent.c:1071]
Ben, is this limited to the 63 bytes, or does it contain references to other memory?
just the 63 bytes, I believe.
Status: NEW → ASSIGNED
nsbeta1- per Nav triage team.
Keywords: nsbeta1nsbeta1-
Target Milestone: --- → mozilla1.2alpha
Does this leak still happen? There is a free() in the end of the function, a lot of early returns could cause this to leak if something fails though. How should code of the type: char *s = strdup(..); rv = ...; if(NS_FAILED(rv) return rv; be handled?
should we use an XPIDL String?
Yes, this leak still shows up in my Purify runs.
I dont see this in my trunk purify log. This was fixed by bsmedberg in bug 191783. (attachment 119179 [details] [diff] [review])
*** This bug has been marked as a duplicate of 191783 ***
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
verified dup
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.