Skip to contentSkip to conversation

target-arm: Fix use of free() in cpu_arm_close()

PATCH In review Andreas Färber 2 participants 3 messages Oct 10, 2011 – Oct 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-arm: Fix use of free() in cpu_arm_close()

env is allocated in cpu_arm_init() with g_malloc0(), so free with g_free().

---
 target-arm/helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-arm/helper.c +1 -1
index d3a3ba2..8195c56 100644
@@ -471,7 +471,7 @@ static uint32_t cpu_arm_find_by_name(const char *name)
 
 void cpu_arm_close(CPUARMState *env)
 {
-    free(env);
+    g_free(env);
 }
 
 uint32_t cpsr_read(CPUARMState *env)
Signature · 1 line
1.7.6.4
#1 lore raw

Am 10.10.2011 14:52, schrieb Andreas Färber:

Quoted 13 lines

env is allocated in cpu_arm_init() with g_malloc0(), so free with g_free().

---
 target-arm/helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
target-arm/helper.c +0 -0
index d3a3ba2..8195c56 100644

target-arm/helper.c static uint32_t cpu_arm_find_by_name(const char *name) · line 477

Quoted 8 lines
target-arm/helper.c +1 -1
@@ -471,7 +471,7 @@ static uint32_t cpu_arm_find_by_name(const char *name)
 
 void cpu_arm_close(CPUARMState *env)
 {
-    free(env);
+    g_free(env);
 }
 
 uint32_t cpsr_read(CPUARMState *env)

Ping! Didn't see this in the pull request... Should it go through qemu-trivial instead?

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746, AG Nürnberg
#2 lore raw
Quoted 21 lines · Andreas Färber

Am 10.10.2011 14:52, schrieb Andreas Färber:

Quoted 20 lines

env is allocated in cpu_arm_init() with g_malloc0(), so free with g_free().

---
 target-arm/helper.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
target-arm/helper.c +1 -1
index d3a3ba2..8195c56 100644
@@ -471,7 +471,7 @@ static uint32_t cpu_arm_find_by_name(const char *name)
 
  void cpu_arm_close(CPUARMState *env)
  {
-    free(env);
+    g_free(env);
  }
 
Quoted 4 lines

target-arm/helper.c static uint32_t cpu_arm_find_by_name(const char *name) · line 477

Quoted 1 line
target-arm/helper.c +0 -0
  uint32_t cpsr_read(CPUARMState *env)

Ping! Didn't see this in the pull request... Should it go through qemu-trivial instead?

Rats, missed that one. I guess I'd better redo the pullreq.

-- PMM