Re: [PATCH] util: Fix memory leak in virJSONParserHandleStartMap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 23, 2011 at 03:55:38PM +0800, Osier Yang wrote:
> ---
>  src/util/json.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/json.c b/src/util/json.c
> index db2727d..48521f2 100644
> --- a/src/util/json.c
> +++ b/src/util/json.c
> @@ -799,8 +799,10 @@ static int virJSONParserHandleStartMap(void *ctx)
>      }
>  
>      if (VIR_REALLOC_N(parser->state,
> -                      parser->nstate + 1) < 0)
> +                      parser->nstate + 1) < 0) {
> +        virJSONValueFree(value);
>          return 0;
> +    }
>  
>      parser->state[parser->nstate].value = value;
>      parser->state[parser->nstate].key = NULL;

 ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]