]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
json.c: avoid an unconditional leak from most qemuMonitorJSON* functions
authorJim Meyering <meyering@redhat.com>
Wed, 27 Jan 2010 08:58:12 +0000 (09:58 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 1 Feb 2010 18:48:34 +0000 (19:48 +0100)
* src/util/json.c (virJSONValueFree): Free the "value" pointer, too.

src/util/json.c

index a292e1bc925500c9930e4787460c3e6c8da566de..1b3c359da0a5aedb086d690489cb9343a0207c89 100644 (file)
@@ -2,7 +2,7 @@
  * json.c: JSON object parsing/formatting
  *
  * Copyright (C) 2009 Daniel P. Berrange
- * Copyright (C) 2009 Red Hat, Inc.
+ * Copyright (C) 2009-2010 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -82,8 +82,9 @@ void virJSONValueFree(virJSONValuePtr value)
     case VIR_JSON_TYPE_NUMBER:
         VIR_FREE(value->data.number);
         break;
-
     }
+
+    VIR_FREE(value);
 }