Re: [PATCH] network: avoid memory leak on cleanup

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

 



2011/7/15  <ajia@xxxxxxxxxx>:
> * src/network/bridge_driver.c: Fix memory leak on cleanup section from
>  networkGetBridgeName function.
> ---
>  src/network/bridge_driver.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 0a12bc0..59e780d 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2474,7 +2474,8 @@ static char *networkGetBridgeName(virNetworkPtr net) {
>  cleanup:
>     if (network)
>         virNetworkObjUnlock(network);
> -    return bridge;
> +    VIR_FREE(bridge);
> +    return NULL;
>  }
>
>  static int networkGetAutostart(virNetworkPtr net,

NACK. Now networkGetBridgeName returns NULL always, that's wrong.

Why do you think that there is a leak?

-- 
Matthias Bolte
http://photron.blogspot.com

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