提交 4517eb0f 编写于 作者: N Nikolay Shirokovskiy 提交者: Maxim Nestratov

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: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 12786889
...@@ -757,8 +757,6 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt) ...@@ -757,8 +757,6 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
} }
buflen = ARRAY_CARDINALITY(macstr); buflen = ARRAY_CARDINALITY(macstr);
if (VIR_ALLOC_N(macstr, buflen))
goto cleanup;
pret = PrlVmDevNet_GetMacAddressCanonical(netAdapter, macstr, &buflen); pret = PrlVmDevNet_GetMacAddressCanonical(netAdapter, macstr, &buflen);
prlsdkCheckRetGoto(pret, cleanup); prlsdkCheckRetGoto(pret, cleanup);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册