[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



"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.


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