[PATCH 2/3] vz: fix memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]