Closed
Bug 257803
Opened 20 years ago
Closed 20 years ago
Possible RegistryKey Leak in nsWindowsShellService
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: henrik, Assigned: rOmAz)
Details
(Whiteboard: [good first bug])
Attachments
(3 files)
831 bytes,
text/plain
|
Details | |
3.68 KB,
patch
|
jshin1987
:
review+
mconnor
:
superreview+
|
Details | Diff | Splinter Review |
1.17 KB,
patch
|
Details | Diff | Splinter Review |
Running my Inspector it found a possible RegKey leak. Will attach a stack trace showing where it is allocated, but apperently never deallocated (missing RegKeyClose)
Reporter | ||
Comment 1•20 years ago
|
||
Seems like a missing RegKeyClose at bottom of method.
Reporter | ||
Comment 2•20 years ago
|
||
Requesting block. * It is a leak (although minor) * Has stack trace pinpointing the problem area * Has AFAIK a easy fix. (One missing RegKeyClose) * Urban legends among trolls is that Firefox leaks, lets not give them ammo note:possibly same error in OpenUserKeyForWriting
Flags: blocking-aviary1.0?
Version: unspecified → Trunk
Updated•20 years ago
|
from msdn.microsoft.com: "The handle for a specified key should not be used after it has been closed, because it will no longer be valid. Key handles should not be left open any longer than necessary." Most functions in nsWindowsShellService.cpp call RegOpenKeyEx without closing it. The patch fixes the problem by adding RegCloseKey in all functions in that file. -rOmAz
Attachment #159326 -
Flags: superreview?(bryner)
Attachment #159326 -
Flags: review?(jshin)
Comment 5•20 years ago
|
||
Comment on attachment 159326 [details] [diff] [review] adds calls to RegCloseKey in missing places r=jshin Thanks for fixing it. Perhaps, we have to fix mozilla as well.
Attachment #159326 -
Flags: review?(jshin) → review+
Updated•20 years ago
|
Flags: blocking-aviary1.0? → blocking-aviary1.0-
Comment 6•20 years ago
|
||
Mike, want to review this and check in?
Comment 7•20 years ago
|
||
Comment on attachment 159326 [details] [diff] [review] adds calls to RegCloseKey in missing places r=me (not really SR, but I don't feel like bugspamming people to make the r=me look right. Thanks for the patch!
Attachment #159326 -
Flags: superreview?(bryner) → superreview+
Updated•20 years ago
|
Whiteboard: [good first bug] → [good first bug] checkin-needed
Comment 8•20 years ago
|
||
Checking in browser/components/shell/src/nsWindowsShellService.cpp; /cvsroot/mozilla/browser/components/shell/src/nsWindowsShellService.cpp,v <-- nsWindowsShellService.cpp new revision: 1.12; previous revision: 1.11 done
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: helpwanted
Resolution: --- → FIXED
Whiteboard: [good first bug] checkin-needed → [good first bug]
Looks like this broke the build: http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox
Comment 10•20 years ago
|
||
Just a typo.
Comment 11•20 years ago
|
||
Comment on attachment 159326 [details] [diff] [review] adds calls to RegCloseKey in missing places Casing issue... >Index: browser/components/shell/src/nsWindowsShellService.cpp >=================================================================== >+ ::RegCloseKey(theKey); This is the right >@@ -581,6 +593,9 @@ > if (REG_FAILED(result) || strcmp(buf, aValue) != 0) > ::RegSetValueEx(theKey, aValueName, 0, REG_SZ, > (LPBYTE)aValue, nsDependentCString(aValue).Length()); >+ >+ // Close the key we opened. >+ ::RegClosekey(theKey); RegClose*K*ey
Comment 12•20 years ago
|
||
Comment on attachment 171448 [details] [diff] [review] Bustage fix checked in by timeless
Comment 13•20 years ago
|
||
(In reply to comment #5) > (From update of attachment 159326 [details] [diff] [review] [edit]) > r=jshin > > Thanks for fixing it. > > Perhaps, we have to fix mozilla as well. > Was this just a Firefox fix? If so, WILL it go into Mozilla as well?
Comment 14•20 years ago
|
||
> Was this just a Firefox fix? Yes. > If so, WILL it go into Mozilla as well? The fix was to Firefox-only code. If you find code in Mozilla that has similar issues, please file a bug on it.
Updated•19 years ago
|
Status: RESOLVED → VERIFIED
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•