]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vz: fix memory leak
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Wed, 6 Apr 2016 11:42:14 +0000 (14:42 +0300)
committerMaxim Nestratov <mnestratov@virtuozzo.com>
Tue, 12 Apr 2016 09:44:26 +0000 (12:44 +0300)
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>
src/vz/vz_sdk.c

index 85ea0d7a984df8fdd12c1867e547cc557f05fad7..f6dfed6d440cb5934cd283f5dd3e1586c576e969 100644 (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);