diff --git a/uc.c b/uc.c index 57cb6e8c..033a26f0 100644 --- a/uc.c +++ b/uc.c @@ -504,6 +504,9 @@ uc_err uc_close(uc_engine *uc) return UC_ERR_OK; } + // Flush all translation buffers or we leak memory allocated by MMU + uc->tb_flush(uc); + // Cleanup internally. if (uc->release) { uc->release(uc->tcg_ctx);