Closed Bug 25585 Opened 25 years ago Closed 25 years ago

Leaking a C string

Categories

(Core :: Networking: Cache, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: beard, Assigned: davidm)

References

()

Details

(Keywords: memory-leak)

nsCacheManager::NoteDormant() is leaking keys that it gets from a call to nsINetDataCacheRecord::GetKey().
Here's a patch that fixes this leak: Index: mozilla/netwerk/cache/mgr/nsCacheManager.cpp =================================================================== RCS file: /cvsroot/mozilla/netwerk/cache/mgr/nsCacheManager.cpp,v retrieving revision 1.6 diff -c -2 -r1.6 nsCacheManager.cpp *** nsCacheManager.cpp 1999/12/07 08:49:42 1.6 --- nsCacheManager.cpp 2000/01/28 23:59:44 *************** *** 221,224 **** --- 221,225 ---- deletedEntry = (nsCachedNetData*)gCacheManager->mActiveCacheRecords-> Remove(&hashTableKey); // NS_ASSERTION(deletedEntry == aEntry, "Hash table inconsistency"); + nsAllocator::Free(key); return NS_OK; }
->cache=gordon
Assignee: gagan → gordon
Target Milestone: M15
I'll apply this patch
Assignee: gordon → davidm
Keywords: mlk
Summary: [MLK] Leaking a C string → Leaking a C string
fix checked in
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
development issue - marking verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.