Closed hwangcc23 closed 3 years ago
1). File handles from fopen should be closed by fclose after use. Free fil_handle in the function doIn after reading date from each file.
2). Memory allocated from xcmalloc/xcrealloc should be freed after use. Free file_names in the function doIn after reading data from all files.
Thank you for catching the resource leak with fil_handle being repeatedly opened without being closed.
@hackerb9 I have updated the PR. Please help review the code again.
1). File handles from fopen should be closed by fclose after use. Free fil_handle in the function doIn after reading date from each file.
2). Memory allocated from xcmalloc/xcrealloc should be freed after use. Free file_names in the function doIn after reading data from all files.