[FL-2502] Properly closing directory on free (#1174)

* Storage: better (at least working) mechanism to distinguish between files and dirs
* Storage API: debug log
* TarArchive: fix stream memleak
* TarArchive: fix another memleak
* Storage: better logs
* Storage: changed the log level to trace

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2022-04-28 02:16:06 +10:00
committed by GitHub
parent 7ce305fca3
commit c60562a02c
3 changed files with 33 additions and 11 deletions

View File

@@ -38,6 +38,7 @@ static int mtar_storage_file_seek(void* stream, unsigned offset) {
static int mtar_storage_file_close(void* stream) {
if(stream) {
storage_file_close(stream);
storage_file_free(stream);
}
return MTAR_ESUCCESS;
}
@@ -93,6 +94,7 @@ void tar_archive_free(TarArchive* archive) {
if(mtar_is_open(&archive->tar)) {
mtar_close(&archive->tar);
}
free(archive);
}
void tar_archive_set_file_callback(TarArchive* archive, tar_unpack_file_cb callback, void* context) {