Closed
Bug 162129
Opened 22 years ago
Closed 22 years ago
Apparent memory leak in COOKIE_Read
Categories
(Core :: Networking: Cookies, defect, P2)
Core
Networking: Cookies
Tracking
()
VERIFIED
FIXED
mozilla1.2beta
People
(Reporter: otaylor, Assigned: morse)
Details
(Keywords: memory-leak)
Attachments
(1 file)
824 bytes,
patch
|
samir_bugzilla
:
review+
jag+mozilla
:
superreview+
|
Details | Diff | Splinter Review |
I was using Mozilla as a test of my MemProf memory profiler and leak detector, and a number of 40 byte leaks were reported in: source/extensions/cookie/nsCookies.cpp:COOKIE_Read (40 bytes is the size of a cookie structure). In a brief read-through of the code, it looks like the culprit is the code: 1790 /* check for bad legacy cookies (domain not starting with a dot) */ 1791 if (new_cookie->isDomain && *new_cookie->host != '.') { 1792 /* bad cookie, discard it */ 1793 continue; 1794 } I believe the cookie (and probably the string it contains) needs to be freed before continuing, since it is just a pointer to a allocated structure. There is also a theoretical memory leak immediately after: in the case where cookie_list couldn't be allocated, the first cookie needs to be freed before returning.
Updated•22 years ago
|
Assignee | ||
Updated•22 years ago
|
Assignee | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
Comment on attachment 96884 [details] [diff] [review] plug up the two leaks sr=jag
Attachment #96884 -
Flags: superreview+
Comment 3•22 years ago
|
||
Comment on attachment 96884 [details] [diff] [review] plug up the two leaks r=sgehani
Attachment #96884 -
Flags: review+
Assignee | ||
Comment 4•22 years ago
|
||
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•