Closed
Bug 16348
Opened 26 years ago
Closed 26 years ago
[MLK] COOKIE_GetCookie() leaks
Categories
(Core :: Networking: Cookies, defect, P2)
Core
Networking: Cookies
Tracking
()
VERIFIED
FIXED
M11
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.]
| Reporter | ||
Updated•26 years ago
|
Priority: P3 → P2
Target Milestone: M11
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Comment 2•25 years ago
|
||
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.
| Assignee | ||
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
| Assignee | ||
Comment 3•25 years ago
|
||
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.
| Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•