Re: [PATCH] cygwin: fix abort of virsh on my system

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

 



On 05/06/2010 02:11 PM, Stefan Berger wrote:
> This strange patch fixes aborts of virsh on my system. It seems that the
> string returned by xmlSaveUri is owned by the xml library??

Hm, I don't think so, at least not according to the documentation:

Function: xmlSaveUri

xmlChar *	xmlSaveUri		(xmlURIPtr uri)

Save the URI as an escaped string
uri:	pointer to an xmlURI
Returns:	a new string (to be deallocated by caller)

The code in libxml2 also seems to confirm this, although it's not entirely
straightforward:

xmlChar *
xmlSaveUri(xmlURIPtr uri) {
    xmlChar *ret = NULL;
    xmlChar *temp;
    const char *p;
    int len;
    int max;

    if (uri == NULL) return(NULL);


    max = 80;
    ret = (xmlChar *) xmlMallocAtomic((max + 1) * sizeof(xmlChar));

...
    ret[len] = 0;
    return(ret);
}

So something else might be going on.  What version of libxml2
are you currently building against?

-- 
Chris Lalancette

--
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]