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

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

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

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;

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

Chris Lalancette

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