From 682a4c468d4cf85e8d43fa7b81d6c527321f1812 Mon Sep 17 00:00:00 2001 From: midipix Date: May 13 2021 08:35:49 +0000 Subject: mdso_map_input(): close the newly opened fd with an empty input file. --- diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c index ab4607f..b7a2677 100644 --- a/src/helper/mdso_map_input.c +++ b/src/helper/mdso_map_input.c @@ -48,12 +48,11 @@ int mdso_map_input( if (st.st_size == 0) { map->size = 0; map->addr = 0; - return 0; + } else { + map->size = st.st_size; + map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0); } - map->size = st.st_size; - map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0); - if (fnew) close(fd);