瀏覽代碼

Forgot to free memory

DocSystem 1 年之前
父節點
當前提交
314057e3b5
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      api/calypso/transit/navigo.c

+ 2 - 0
api/calypso/transit/navigo.c

@@ -250,6 +250,7 @@ char* get_navigo_station(
                        line_station_id == station_id && line_station_sub_id == station_sub_id) {
                         found_station_name =
                             strdup(get_token(string_line_copy, ",", string_line_copy));
+                        free(string_line_copy);
                         break;
                     }
                     free(string_line_copy);
@@ -303,6 +304,7 @@ char* get_navigo_station(
                        line_station_id == station_id) {
                         found_station_name =
                             strdup(get_token(string_line_copy, ",", string_line_copy));
+                        free(string_line_copy);
                         break;
                     }
                     free(string_line_copy);