[virt-tools-list] [libosinfo PATCH] Fix libxml error reporting

Guido Günther agx at sigxcpu.org
Fri Nov 25 08:30:27 UTC 2011


On Fri, Nov 18, 2011 at 11:03:41PM +0100, Guido Günther wrote:
> The error code might be set in catchXMLError so make sure we don't miss
> it. Otherwise this results in errors like:
> 
> /usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: GError set over the top of a previous GError or uninitialized memory.
> This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
> The overwriting error message was: Incorrect root element

Can this be appplied?
 -- Guido

> ---
>  osinfo/osinfo_loader.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
> index 8a3de6a..e479301 100644
> --- a/osinfo/osinfo_loader.c
> +++ b/osinfo/osinfo_loader.c
> @@ -805,7 +805,7 @@ static void osinfo_loader_process_xml(OsinfoLoader *loader,
>      xml = xmlCtxtReadDoc(pctxt, BAD_CAST xmlStr, src, NULL,
>                           XML_PARSE_NOENT | XML_PARSE_NONET |
>                           XML_PARSE_NOWARNING);
> -    if (!xml)
> +    if (!xml || *err)
>          goto cleanup;
>  
>      root = xmlDocGetRootElement(xml);
> -- 
> 1.7.7.1
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list