Fix leaked FD for an empty file

This commit is contained in:
Nobuyoshi Nakada 2023-06-22 12:35:06 +09:00
parent 010b8a29dc
commit ddb431c960
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2023-06-22 05:21:42 +00:00

View File

@ -72,6 +72,7 @@ source_file_load(source_t *source, VALUE filepath) {
#ifdef HAVE_MMAP
if (!source->size) {
close(fd);
source->source = "";
return 0;
}