Fixes Coverity CID 1042340. Signed-off-by: Mikko Rapeli <mikko.rapeli@xxxxxx> --- maps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/maps.c b/maps.c index 62b2328..b61575e 100644 --- a/maps.c +++ b/maps.c @@ -114,7 +114,8 @@ static void * alloc_zero_map(struct map *map, int prot, const char *name) output(2, "mapping[%d]: (zeropage %s) %p (%lu bytes)\n", num_mappings - 1, name, tmpmap->ptr, size); - close(fd); + if (fd >= 0) + close(fd); return tmpmap; } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe trinity" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html