From 1cb334efba3beb363ab09f0866413e6fee2a1a28 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 27 Jan 2010 09:58:12 +0100 Subject: [PATCH] json.c: avoid an unconditional leak from most qemuMonitorJSON* functions * src/util/json.c (virJSONValueFree): Free the "value" pointer, too. --- src/util/json.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/json.c b/src/util/json.c index a292e1bc92..1b3c359da0 100644 --- a/src/util/json.c +++ b/src/util/json.c @@ -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); }