Re: [PATCH 23/49] list: Implement listAllNetworks for network driver

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

 



On 07/23/2012 03:12 PM, Laine Stump wrote:
> On 07/20/2012 10:25 AM, Osier Yang wrote:
>> src/network/bridge_driver.c: Implement listAllNetworks.
>> ---
>>  src/network/bridge_driver.c |   18 ++++++++++++++++++
>>  1 files changed, 18 insertions(+), 0 deletions(-)

>>  
>> +static int
>> +networkListAllNetworks(virConnectPtr conn,
>> +                       virNetworkPtr **nets,
>> +                       unsigned int flags)
>> +{
>> +    struct network_driver *driver = conn->networkPrivateData;
>> +    int ret = -1;
>> +
>> +    virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1);
> 
> If you return with an error here, nets will be unset. Even though a
> *sane* caller would check the return value prior to dereferencing
> anything in nets, it would still be a good idea to to "*nets = NULL"
> before anything else.

Then again. libvirt.c _already_ did *nets=NULL before getting into this
driver callback.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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