fixed possible overflow on mmap() fail + missing retval