Bug 603311 HashMgr::load_tables leaks dict when decode_flags fails. r=ryanvm, a=roc.
authortimeless@mozdev.org
Sun, 30 Jan 2011 12:43:50 +1300
changeset 61624 dfdded687f2a
parent 61623 6a05c245907e
child 61625 8cfa767f666c
push id18412
push userjwatt@jwatt.org
push date2011-01-30 08:06 +0000
treeherdermozilla-central@336d5906cb0f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersryanvm, roc
bugs603311
milestone2.0b11pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 603311 HashMgr::load_tables leaks dict when decode_flags fails. r=ryanvm, a=roc.
extensions/spellcheck/hunspell/src/hashmgr.cpp
--- a/extensions/spellcheck/hunspell/src/hashmgr.cpp
+++ b/extensions/spellcheck/hunspell/src/hashmgr.cpp
@@ -497,16 +497,17 @@ int HashMgr::load_tables(const char * tp
         if (!al) {
             HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n", dict->getlinenum());
             *ap = '\0';
         }
       } else {
         al = decode_flags(&flags, ap + 1, dict);
         if (al == -1) {
             HUNSPELL_WARNING(stderr, "Can't allocate memory.\n");
+            delete dict;
             return 6;
         }
         flag_qsort(flags, 0, al);
       }
     } else {
       al = 0;
       ap = NULL;
       flags = NULL;