diff options
Diffstat (limited to 'tools/firmware-utils')
-rw-r--r-- | tools/firmware-utils/src/zytrx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/zytrx.c b/tools/firmware-utils/src/zytrx.c index 302efc6010..7167679206 100644 --- a/tools/firmware-utils/src/zytrx.c +++ b/tools/firmware-utils/src/zytrx.c @@ -150,8 +150,10 @@ static void *map_input(const char *name, size_t *len) } *len = stat.st_size; mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0); - if (close(fd) < 0) + if (close(fd) < 0) { + (void) munmap(mapped, stat.st_size); return NULL; + } return mapped; } |