Patchwork [6/7] Fix mismatching allocation and deallocation

login
register
mail settings
Submitter Stefan Hajnoczi
Date Oct. 5, 2011, 8:47 a.m.
Message ID <1317804479-5876-7-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/117774/
State New
Headers show

Comments

Stefan Hajnoczi - Oct. 5, 2011, 8:47 a.m.
From: Stefan Weil <weil@mail.berlios.de>

This error was reported by cppcheck.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/console.c b/console.c
index 6dfcc47..e43de92 100644
--- a/console.c
+++ b/console.c
@@ -1538,7 +1538,7 @@  int text_console_init(QemuOpts *opts, CharDriverState **_chr)
     }
 
     if (!s) {
-        free(chr);
+        g_free(chr);
         return -EBUSY;
     }