Closed Bug 16348 Opened 26 years ago Closed 26 years ago

[MLK] COOKIE_GetCookie() leaks

Categories

(Core :: Networking: Cookies, defect, P2)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: mozilla, Assigned: morse)

References

()

Details

The function COOKIE_GetCookie() leaks memory under certain situations. One of the first things it does is call cookie_ParseURL() twice to get "host" and "path" strings. These strings end up being allocated via calls to PL_strdup(). However, COOKIE_GetCookie() has situations where it just "return"s in the middle of the function without calling PR_Free(). [Note: both "host" and "path" variables are PR_Free()'ed at the end of the function, if it reaches the end.] Please either use PR_Free() for "host" and "path" at every "return" point in the GetCookie() function, or rewrite the function to not "return" anywhere in the middle of the routine's execution, so that the PR_Free()s at the end have a chance to free up the memory leaks. Also, it might be good to add some more NULL checking, as either "host" or "path" could be NULL. [Note: Leaks found using beard's Boehm GC.]
Priority: P3 → P2
Target Milestone: M11
Status: NEW → ASSIGNED
*** Bug 16392 has been marked as a duplicate of this bug. ***
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Steve, do you know if 16348 (this bug) and dup 16392 have been addressed and if so can you mark this verified? I don't have a mem leak tool readily available.
Status: RESOLVED → VERIFIED
Yes, they have been fixed. Marking verified as per your instructions. But this feels like cheating since I'm the one who fixed it and now I'm verifying my own fix.
You need to log in before you can comment on or make changes to this bug.