summaryrefslogtreecommitdiff
path: root/patches/OOO_1_1_2/lingucomponent-memleaks.diff
blob: 8c474c25a108e4fde802983e16d094bb374bb0c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- lingucomponent/source/spellcheck/myspell/affixmgr.cxx.~1.12.14.1.~	Fri May  7 11:48:19 2004
+++ lingucomponent/source/spellcheck/myspell/affixmgr.cxx	Sun Jun  6 10:34:16 2004
@@ -763,7 +763,7 @@
 char * AffixMgr::get_compound()
 {
   if (! compound ) return NULL;
-  return mystrdup(compound);
+  return compound;
 }
 
 // utility method to look up root words in hash table
--- lingucomponent/source/spellcheck/myspell/suggestmgr.cxx.~1.7.14.3.~	Fri May  7 11:48:19 2004
+++ lingucomponent/source/spellcheck/myspell/suggestmgr.cxx	Sat Jun  5 17:08:29 2004
@@ -375,21 +375,28 @@
                                         rp->astr, rp->alen);
         for (int k = 0; k < nw; k++) {
            sc = ngram(n, word, glst[k].word, NGRAM_ANY_MISMATCH);
-           if (sc > thresh) {
-              if (sc > gscore[lp]) {
-	         if (guess[lp]) free (guess[lp]);
-                 gscore[lp] = sc;
-                 guess[lp] = glst[k].word;
-                 lval = sc;
-                 for (j=0; j < MAX_GUESS; j++)
-	            if (gscore[j] < lval) {
-	               lp = j;
-                       lval = gscore[j];
-	            }
-	      } else {
-                 free (glst[k].word);  
-              }
-	   }            
+	   if (sc > thresh)
+	   {
+		if (sc > gscore[lp])
+		{
+			if (guess[lp]) free(guess[lp]);
+			gscore[lp] = sc;
+			guess[lp] = glst[k].word;
+			glst[k].word = NULL;
+			lval = sc;
+			for (j=0; j < MAX_GUESS; j++)
+			{
+				if (gscore[j] < lval)
+				{
+					lp = j;
+					lval = gscore[j];
+				}
+			}
+		}
+	   }
+	   free (glst[k].word);
+	   glst[k].word = NULL;
+	   glst[k].allow = 0;
 	}
       }
   }