diff --git a/osslsigncode.c b/osslsigncode.c index 259b471..9e9340c 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -4865,10 +4865,12 @@ static char *map_file(const char *infile, const size_t size) return NULL; } fmap = CreateFileMapping(fhandle, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(fhandle); if (fmap == NULL) { return NULL; } indata = (char *)MapViewOfFile(fmap, FILE_MAP_READ, 0, 0, 0); + CloseHandle(fmap); #else int fd = open(infile, O_RDONLY); if (fd < 0) { @@ -5076,6 +5078,7 @@ static int read_password(GLOBAL_OPTIONS *options) return 0; /* FAILED */ } faddress = MapViewOfFile(fmap, FILE_MAP_READ, 0, 0, 0); + CloseHandle(fmap); if (faddress == NULL) { return 0; /* FAILED */ }