mirror of
https://github.com/Vita3K/unicorn.git
synced 2024-11-26 23:00:37 +00:00
fixed leaks in test cases (#1247)
This commit is contained in:
parent
1ad541cd55
commit
9fedbd96f4
@ -301,6 +301,7 @@ static void test_i386_map_ptr(void)
|
||||
printf(">>> Failed to read 4 bytes from [0x%x]\n", ADDRESS);
|
||||
|
||||
uc_close(uc);
|
||||
free(mem);
|
||||
}
|
||||
|
||||
static void test_i386_jump(void)
|
||||
|
@ -280,6 +280,7 @@ static void gdt_demo()
|
||||
assert(memcmp(buf, "\x67\x45\x23\x01\xef\xcd\xab\x89", 8) == 0);
|
||||
|
||||
uc_close(uc);
|
||||
free(gdt);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -27,5 +27,6 @@ int main()
|
||||
uc_mem_write (uc, UC_BUG_WRITE_ADDR, buf, size);
|
||||
}
|
||||
uc_close(uc);
|
||||
free(buf);
|
||||
return 0;
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ int main()
|
||||
uc_hook_add(uc, &uh_trap, UC_HOOK_INTR, _interrupt, NULL, 1, 0);
|
||||
uc_emu_start(uc, UC_BUG_WRITE_ADDR, UC_BUG_WRITE_ADDR+8, 0, 1);
|
||||
uc_close(uc);
|
||||
free(buf);
|
||||
printf ("Correct: %s\n", got_sigill? "YES": "NO");
|
||||
return got_sigill? 0: 1;
|
||||
}
|
||||
|
BIN
tests/regress/x86_vex
Executable file
BIN
tests/regress/x86_vex
Executable file
Binary file not shown.
@ -63,6 +63,8 @@ static void test_basic(void **state)
|
||||
uc_assert_success(uc_mem_unmap(uc, mem_start, mem_len));
|
||||
|
||||
assert_memory_equal(buf, host_mem, 4);
|
||||
|
||||
free(host_mem);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user