Fix memory leak issues 37/101537/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.141642 accepted/tizen/3.0.m2/tv/20170104.142110 accepted/tizen/3.0.m2/wearable/20170104.142400 accepted/tizen/3.0/common/20161203.012232 accepted/tizen/3.0/ivi/20161202.005849 accepted/tizen/3.0/mobile/20161202.005758 accepted/tizen/3.0/tv/20161202.005810 accepted/tizen/3.0/wearable/20161202.005827 submit/tizen_3.0.m2/20170104.093751 submit/tizen_3.0/20161201.065323
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:31:07 +0000 (19:31 +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