diff --git a/qemu/translate-all.c b/qemu/translate-all.c index b599ee3d..a62e3b57 100644 --- a/qemu/translate-all.c +++ b/qemu/translate-all.c @@ -722,11 +722,11 @@ static inline void *alloc_code_gen_buffer(struct uc_struct *uc) case 1: if (!cross_256mb(buf2, size)) { /* Success! Use the new buffer. */ - munmap(buf, size); + munmap(buf, size + qemu_real_host_page_size); break; } /* Failure. Work with what we had. */ - munmap(buf2, size); + munmap(buf2, size + qemu_real_host_page_size); /* fallthru */ default: /* Split the original buffer. Free the smaller half. */