Skip to content

Commit

Permalink
target/ppc: use g_free() in test_opcode_table()
Browse files Browse the repository at this point in the history
table[i] is allocated in create_new_table() using g_new().

Use g_free(table[i]) instead of free(table[i]) to comply with QEMU low
level memory management guidelines.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
[Mjt: minor commit comment tweak]
  • Loading branch information
danielhb authored and Michael Tokarev committed Sep 8, 2023
1 parent 44adcaa commit 95eac43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/ppc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -7158,7 +7158,7 @@ static int test_opcode_table(opc_handler_t **table, int len)
tmp = test_opcode_table(ind_table(table[i]),
PPC_CPU_INDIRECT_OPCODES_LEN);
if (tmp == 0) {
free(table[i]);
g_free(table[i]);
table[i] = &invalid_handler;
} else {
count++;
Expand Down

0 comments on commit 95eac43

Please sign in to comment.