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

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Wed Apr 6 11:42:14 UTC 2016


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);
 
-- 
1.8.3.1




More information about the libvir-list mailing list