Fix memory leak issues 36/101536/1 accepted/tizen/common/20161201.140020 accepted/tizen/ivi/20161202.005956 accepted/tizen/mobile/20161202.005905 accepted/tizen/tv/20161202.005921 accepted/tizen/unified/20170309.034610 accepted/tizen/wearable/20161202.005936 submit/tizen/20161201.115558 submit/tizen_unified/20170308.100410
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 1 Dec 2016 10:30:31 +0000 (19:30 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 1 Dec 2016 10:30:31 +0000 (19:30 +0900)
Change-Id: I30b264d5de68b78081afc855b5ae3d1847dc06e3
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
calctrans/calctrans.c
mkworddic/mkdic.c
test/main.c

index e7f7ddf..f4609f6 100755 (executable)
@@ -341,6 +341,8 @@ dump_features(FILE *ofp, struct input_set *is)
   for (i = 0; i < nr; i++) {
     dump_line(ofp, lines[i]);
   }
+
+  free(lines);
 }
 
 static void
@@ -709,6 +711,7 @@ main(int argc, char **argv)
       ofp = stdout;
     }
     extract_word(nr_input, input_files, ofp);
+    free(input_files);
     return 0;
   }
   if (ofp) {
@@ -721,5 +724,7 @@ main(int argc, char **argv)
     convert_data(nr_input, input_files);
   }
 
+  free(input_files);
+
   return 0;
 }
index 7c99fe0..8f0502d 100755 (executable)
@@ -574,7 +574,8 @@ mk_yomi_hash(FILE *yomi_hash_out, struct yomi_entry_list *yl)
   fwrite(hash_array, YOMI_HASH_ARRAY_SIZE, 1, yomi_hash_out);
   printf("generated yomi hash bitmap (%d collisions/%d entries)\n",
         yomi_hash_collision, yl->nr_valid_entries);
-        
+
+  free(hash_array);
 }
 
 static struct adjust_command *
index 5ba1450..295cc9d 100755 (executable)
@@ -303,6 +303,7 @@ save_db(const char *fn, struct res_db *db)
   for (cr = db->res_list.next; cr; cr = cr->next) {
     dump_res(fp, cr);
   }
+  fclose(fp);
 }
 
 static void