From ed40eafc13635a523e2bd4396ce7312fbc84873a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Sat, 31 May 2025 03:32:19 +0900 Subject: [PATCH] fix: mis-closed file before init --- file.h | 1 + 1 file changed, 1 insertion(+) diff --git a/file.h b/file.h index 9021317..5aa4d45 100644 --- a/file.h +++ b/file.h @@ -143,6 +143,7 @@ int file_cache_realloc(file_cache_t* fc, uint64_t newsize) { } int file_cache_close(file_cache_t* fc) { + if(!fc->data) return 0; if(munmap(fc->data - sizeof(uint64_t), fc->size) < 0) { perror("munmap"); return -1;