From c197d7727cbdecbba8165c9f6ba19b0201544f5b Mon Sep 17 00:00:00 2001 From: olszomal Date: Wed, 11 Jan 2023 15:04:31 +0100 Subject: [PATCH] close file and file mapping handles --- osslsigncode.c | 3 +++ 1 file changed, 3 insertions(+) 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 */ }