Patchwork Fix mismatching allocation and deallocation

login
register
mail settings
Submitter Stefan Weil
Date Oct. 2, 2011, 4:53 p.m.
Message ID <1317574389-15007-1-git-send-email-weil@mail.berlios.de>
Download mbox | patch
Permalink /patch/117340/
State Accepted
Headers show

Comments

Stefan Weil - Oct. 2, 2011, 4:53 p.m.
This error was reported by cppcheck.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Stefan Hajnoczi - Oct. 5, 2011, 8:23 a.m.
On Sun, Oct 02, 2011 at 06:53:09PM +0200, Stefan Weil wrote:
> This error was reported by cppcheck.
> 
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  console.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

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;
     }