]> xenbits.xensource.com Git - libvirt.git/commitdiff
parallels: Fix initialization of buflen variable in each loop iteration
authorMikhail Feoktistov <mfeoktistov@virtuozzo.com>
Wed, 17 Jun 2015 12:35:00 +0000 (15:35 +0300)
committerDmitry Guryanov <dguryanov@parallels.com>
Thu, 18 Jun 2015 11:08:48 +0000 (14:08 +0300)
We need to initialize buflen every time when we get network adapter's
friendly name because we call PrlVmDev_GetFriendlyName in a loop

src/vz/vz_sdk.c

index f9cde44475f2dc90afdaa37da0bec7d7b592e482..c36dad680827b62d26d3c0397b40a85ea1b3e222 100644 (file)
@@ -3150,6 +3150,7 @@ prlsdkGetDiskIndex(PRL_HANDLE sdkdom, virDomainDiskDefPtr disk)
         pret = PrlVmCfg_GetHardDisk(sdkdom, i, &hdd);
         prlsdkCheckRetGoto(pret, cleanup);
 
+        buflen = 0;
         pret = PrlVmDev_GetFriendlyName(hdd, 0, &buflen);
         prlsdkCheckRetGoto(pret, cleanup);