Re: PATCH: 9/16: main internal storage driver

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

 



On Mon, Feb 18, 2008 at 10:25:04AM +0100, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> ...
> > diff -r 77cf7f42edd4 src/storage_conf.c
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/src/storage_conf.c	Thu Feb 07 12:59:40 2008 -0500
> ...
> > +    if (options->flags & VIR_STORAGE_BACKEND_POOL_SOURCE_DEVICE) {
> > +        xmlNodePtr *nodeset = NULL;
> > +        int nsource, i;
> > +
> > +        if ((nsource = virXPathNodeSet("/pool/source/device", ctxt, &nodeset)) <= 0) {
> > +            virStorageReportError(conn, VIR_ERR_XML_ERROR, "cannot extract source devices");
> > +            goto cleanup;
> > +        }
> > +        if ((ret->source.devices = calloc(nsource, sizeof(*ret->source.devices))) == NULL) {
> > +            free(nodeset);
> > +            virStorageReportError(conn, VIR_ERR_NO_MEMORY, "device");
> > +            goto cleanup;
> > +        }
> > +        for (i = 0 ; i < nsource ; i++) {
> > +            xmlChar *path = xmlGetProp(nodeset[i], BAD_CAST "path");
> > +            if (path == NULL) {
> > +                virStorageReportError(conn, VIR_ERR_XML_ERROR, "missing source device path");
> 
> It looks like you need to free nodeset here, too.

Yes, thanks

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

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