[libvirt] [PATCH 2/3] vz: fix memory leak

Maxim Nestratov mnestratov at virtuozzo.com
Tue Apr 12 09:47:06 UTC 2016


06.04.2016 14:42, Nikolay Shirokovskiy пишет:
> we don't need to allocate mastr at all as it is array
> and already have the the space it needs.
>
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
> ---
>   src/vz/vz_sdk.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index 0d853d0..443f753 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -749,8 +749,6 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
>       }
>   
>       buflen = ARRAY_CARDINALITY(macstr);
> -    if (VIR_ALLOC_N(macstr, buflen))
> -        goto cleanup;
>       pret = PrlVmDevNet_GetMacAddressCanonical(netAdapter, macstr, &buflen);
>       prlsdkCheckRetGoto(pret, cleanup);
>   

Pushed this one correcting commit message a bit.

Thanks,
Maxim




More information about the libvir-list mailing list