Przeglądaj źródła

fix strtotime bug

weicky 2 lat temu
rodzic
commit
7645fdf7ad
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      main.c

+ 1 - 1
main.c

@@ -823,7 +823,6 @@ static TCHAR *string_convert_to_time(const TCHAR *in, int in_len, int *out_len)
     //wchar*转char*
     cpy = wchar_to_acp(in, in_len, &cpy_len);
     ts = (time_t)atoi(cpy);
-    free(cpy);
     //char*转timelib_time(struct)再转int64_t
     now = timelib_time_ctor();
 	now->tz_info = gTimeZoneInfo;
@@ -837,6 +836,7 @@ static TCHAR *string_convert_to_time(const TCHAR *in, int in_len, int *out_len)
 	ts = (int64_t)timelib_date_to_int(t, &error2);
 	timelib_time_dtor(now);
 	timelib_time_dtor(t);
+    free(cpy);
 	//将int64_t转为char*
 	if (error1 || error2)
     {