[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/23] target/ppc: use g_free() in test_opcode_table()
From: |
Michael Tokarev |
Subject: |
[PULL 20/23] target/ppc: use g_free() in test_opcode_table() |
Date: |
Fri, 8 Sep 2023 12:55:17 +0300 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
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]
---
target/ppc/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 6b242ae0a6..5c28afbbb8 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -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++;
--
2.39.2
- [PULL 11/23] misc/other: spelling fixes, (continued)
- [PULL 11/23] misc/other: spelling fixes, Michael Tokarev, 2023/09/08
- [PULL 12/23] block: spelling fixes, Michael Tokarev, 2023/09/08
- [PULL 13/23] hw/display/xlnx_dp: update comments, Michael Tokarev, 2023/09/08
- [PULL 14/23] qemu-options.hx: Rephrase the descriptions of the -hd* and -cdrom options, Michael Tokarev, 2023/09/08
- [PULL 15/23] docs tests: Fix use of migrate_set_parameter, Michael Tokarev, 2023/09/08
- [PULL 16/23] tests/qtest/test-hmp: Fix migrate_set_parameter xbzrle-cache-size test, Michael Tokarev, 2023/09/08
- [PULL 17/23] accel/tcg: Fix typo in translator_io_start() description, Michael Tokarev, 2023/09/08
- [PULL 18/23] trivial: Simplify the spots that use TARGET_BIG_ENDIAN as a numeric value, Michael Tokarev, 2023/09/08
- [PULL 19/23] hw/ppc: use g_free() in spapr_tce_table_post_load(), Michael Tokarev, 2023/09/08
- [PULL 21/23] tests/qtest/usb-hcd: Remove the empty "init" tests, Michael Tokarev, 2023/09/08
- [PULL 20/23] target/ppc: use g_free() in test_opcode_table(),
Michael Tokarev <=
- [PULL 22/23] hw/net/vmxnet3: Fix guest-triggerable assert(), Michael Tokarev, 2023/09/08
- [PULL 23/23] qxl: don't assert() if device isn't yet initialized, Michael Tokarev, 2023/09/08