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

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> 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.

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