Skip to contentSkip to conversation

change free() to g_free() to pair with g_malloc() series.

PATCH In review Ray Wang 2 participants 2 messages Oct 17, 2011 Block layer

lore
Share & tools
lore

Ray Wang

author
#0 lore raw

PATCH 1/1 change free() to g_free() to pair with g_malloc() series.

---
 block/dmg.c         |   14 +++++++-------
 target-arm/helper.c |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
block/dmg.c +7 -7
index 64c3cce..661f31b 100644
@@ -284,14 +284,14 @@ static void dmg_close(BlockDriverState *bs)
 {
     BDRVDMGState *s = bs->opaque;
     if(s->n_chunks>0) {
-	free(s->types);
-	free(s->offsets);
-	free(s->lengths);
-	free(s->sectors);
-	free(s->sectorcounts);
+	g_free(s->types);
+	g_free(s->offsets);
+	g_free(s->lengths);
+	g_free(s->sectors);
+	g_free(s->sectorcounts);
     }
-    free(s->compressed_chunk);
-    free(s->uncompressed_chunk);
+    g_free(s->compressed_chunk);
+    g_free(s->uncompressed_chunk);
     inflateEnd(&s->zstream);
 }
 
target-arm/helper.c +1 -1
index e2428eb..2b17dc9 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.4.1
#1 lore raw

Am 17.10.2011 12:03, schrieb Ray Wang:

Quoted 11 lines
---
 block/dmg.c         |   14 +++++++-------
 target-arm/helper.c |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
target-arm/helper.c +0 -0
index e2428eb..2b17dc9 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)

For this last part I had already sent a patch.

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