Revision: 6301
Author: ek.kato
Date: Sat Apr  3 14:34:57 2010
Log: * helper/dict-canna-cclass.c
  - (find_desc_from_code_with_type) : Plug leak.
  - (find_code_from_desc) : Ditto.

http://code.google.com/p/uim/source/detail?r=6301

Modified:
 /trunk/helper/dict-canna-cclass.c

=======================================
--- /trunk/helper/dict-canna-cclass.c   Tue Jul 21 21:11:27 2009
+++ /trunk/helper/dict-canna-cclass.c   Sat Apr  3 14:34:57 2010
@@ -308,7 +308,7 @@
 const char *find_desc_from_code_with_type(const char *code, int type) {
   /* need to be more smart */
   int i = 0, j = 0;
-  char *pos = NULL;
+  const char *pos = NULL;
   category_code *category[] = {
     substantive_code,
     verb_code,
@@ -329,7 +329,7 @@
   do {
     for (j = 0; j < num[i]; j++) {
       if ((i == type ) && !strcmp(code, (category[i])[j].code))
-       pos = strdup((category[i])[j].desc);
+       pos = (category[i])[j].desc;
     }
     i++;
   } while (category[i] != NULL);
@@ -340,7 +340,7 @@
 const char *find_code_from_desc(const char *desc, int type) {
     /* need to be more smart */
     int i = 0, j = 0;
-    char *code = NULL;
+    const char *code = NULL;
     category_code *category[] = {
       substantive_code,
       verb_code,
@@ -361,7 +361,7 @@
     do {
       for (j = 0; j < num[i]; j++) {
        if ((i == type) && !strcmp(desc, (category[i])[j].desc))
-         code = strdup((category[i])[j].code);
+         code = (category[i])[j].code;
       }
       i++;
     } while (category[i] != NULL);


--
To unsubscribe, reply using "remove me" as the subject.

Reply via email to