vz: fix memory leak

we don't need to allocate macstr at all as it is an array
and already has the the space it needs.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-04-06 14:42:14 +03:00 committed by Maxim Nestratov
parent 1278688921
commit 4517eb0f4e

View File

@ -757,8 +757,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);