Closed Bug 465612 Opened 16 years ago Closed 14 years ago

SuggestMgr::SuggestMgr leaks csconv

Categories

(Core :: Spelling checker, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bc, Unassigned)

References

Details

(Keywords: memory-leak, valgrind)

Attachments

(1 file, 1 obsolete file)

start/stop browser

==5146== 2,304 bytes in 3 blocks are definitely lost in loss record 121 of 156
==5146==    at 0x40053C0: malloc (vg_replace_malloc.c:149)
==5146==    by 0x486F8B3: get_current_cs(char const*) (csutil.cpp:5244)
==5146==    by 0x4885465: SuggestMgr::SuggestMgr(char const*, int, AffixMgr*) (suggestmgr.cpp:107)
==5146==    by 0x487B9BC: Hunspell::Hunspell(char const*, char const*, char const*) (hunspell.cpp:105)
==5146==    by 0x485669A: mozHunspell::SetDictionary(unsigned short const*) (mozHunspell.cpp:157)
==5146==    by 0x48393EF: mozSpellChecker::SetCurrentDictionary(nsAString_internal const&) (mozSpellChecker.cpp:373)
==5146==    by 0xBC390ED: nsEditorSpellCheck::SetCurrentDictionary(unsigned short const*) (nsEditorSpellCheck.cpp:455)
==5146==    by 0xBC3ABB9: nsEditorSpellCheck::InitSpellChecker(nsIEditor*, int) (nsEditorSpellCheck.cpp:212)
==5146==    by 0x4845B15: mozInlineSpellChecker::SetEnableRealTimeSpell(int) (mozInlineSpellChecker.cpp:724)
==5146==    by 0x9AE51DB: nsEditor::SyncRealTimeSpell() (nsEditor.cpp:1341)
==5146==    by 0x9AE305F: nsEditor::PostCreate() (nsEditor.cpp:246)
==5146==    by 0x95BD224: nsTextControlFrame::SetInitialChildList(nsIAtom*, nsIFrame*) (nsTextControlFrame.cpp:2812)

SuggestMgr::SuggestMgr inits csconv with a malloc (via get_current_cs) but doesn't free it in the destructor.
Nemeth, as best I can tell, 1.2.9 does not address this. Is that correct?
Attached patch proposed fix (obsolete) — Splinter Review
Give this a go. There is moz specific code in hunspell to use a dynamic result from get_current_cs which is why it doesn't show up on testing of the standalone version. While I'm at it, there's a mix of malloc/delete as well so also changed to use new[] delete[]
Attachment #441759 - Attachment is obsolete: true
Any comments, timeless? I'll mark this bug as depending on a future Hunspell 1.2.10 bug upon release.
Depends on: 564608
Fixed by bug 564608
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Depends on: 571728
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: