Re: [libvirt] [PATCH 1/5] write pid file into stateDir

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

 



On Fri, Dec 12, 2008 at 11:35:03AM -0800, David Lutterkort wrote:
> On Fri, 2008-12-12 at 19:26 +0100, Guido Günther wrote:
> > diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> > index ca96223..a2e573e 100644
> > --- a/src/qemu_driver.c
> > +++ b/src/qemu_driver.c
> > @@ -220,6 +220,10 @@ qemudStartup(void) {
> >  
> >          if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
> >              goto out_of_memory;
> > +
> > +        if (asprintf (&qemu_driver->stateDir,
> > +                      "%s/run/libvirt/qemu/", LOCAL_STATE_DIR) == -1)
> > +            goto out_of_memory;
> 
> You need to explicitly set qemu_driver->stateDir to NULL if asprintf
> fails, since it leaves the pointer in an undefined state.
> 
> > +
> > +        if (asprintf (&qemu_driver->stateDir,
> > +                      "%s/run/libvirt/qemu/", base) == -1)
> > +            goto out_of_memory;
> > +    }
> 
> Same here
Done via virAsprintf. Thanks for pointing this out.
 -- Guido

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