[Libvir] Patch to attach/detach virtual devices on a running domain

Daniel Veillard veillard at redhat.com
Tue Nov 21 17:04:21 UTC 2006


On Tue, Nov 21, 2006 at 05:27:20PM +0100, michel.ponceau at bull.net wrote:
> There is a bug in GetNetworkID(): return(ret) with ret=list[i], after 
> free(list). It leads to process abort on free(xref) in caller XMLDevID(). I corrected this by replacing:
>         ret = list[i];
> by:
>         ret = malloc(16);
>         if (ret != NULL) strcpy(ret, list[i]);
> Our tests were successful afterwards.

  Dohh, list is being freed before exit ...  I changed that to
     
     ret = strdup(list[i]);

if strdup fails this will return NULL the error code, and that's
simpler,

   thanks !

Daniel

P.S.: could you provide some of the XML you use for your tests ? that would
      help me write the associated docs and do a bit of testing on my own.

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list