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

login
register
mail settings
Submitter Ray Wang
Date Oct. 17, 2011, 10:03 a.m.
Message ID <1318845836-30088-1-git-send-email-raywang@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/120137/
State New
Headers show

Comments

Ray Wang - Oct. 17, 2011, 10:03 a.m.
Signed-off-by: Ray Wang <raywang@linux.vnet.ibm.com>
---
 block/dmg.c         |   14 +++++++-------
 target-arm/helper.c |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
Andreas Färber - Oct. 17, 2011, 11:11 a.m.
Am 17.10.2011 12:03, schrieb Ray Wang:
> Signed-off-by: Ray Wang <raywang@linux.vnet.ibm.com>
> ---
>  block/dmg.c         |   14 +++++++-------
>  target-arm/helper.c |    2 +-
>  2 files changed, 8 insertions(+), 8 deletions(-)

> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index e2428eb..2b17dc9 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -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

Patch

diff --git a/block/dmg.c b/block/dmg.c
index 64c3cce..661f31b 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -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);
 }
 
diff --git a/target-arm/helper.c b/target-arm/helper.c
index e2428eb..2b17dc9 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -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)