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

Re: [libvirt] PATCH: 1/2: port Test driver to network APIs



On Thu, Jul 03, 2008 at 08:27:07AM +0200, Jim Meyering wrote:
> "Daniel P. Berrange" <berrange redhat com> wrote:
> ...
> cont'd
> 
> >  static int testNetworkUndefine(virNetworkPtr network) {
> ...
> >  static char *testNetworkGetBridgeName(virNetworkPtr network) {
> >      char *bridge;
> >      GET_NETWORK(network, NULL);
> > -    bridge = strdup(privnet->bridge);
> > +    bridge = privnet->def->bridge ? strdup(privnet->def->bridge) : NULL;
> >      if (!bridge) {
> >          testError(network->conn, NULL, network, VIR_ERR_NO_MEMORY, "network");
> >          return NULL;
> 
> This change makes it so a NULL privnet->def->bridge will
> mistakenly provoke an out of memory error.

Yep, that's bogus

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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