Changeset 107671 in vbox
- Timestamp:
- Jan 10, 2025 3:38:26 PM (2 months ago)
- svn:sync-xref-src-repo-rev:
- 166763
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r107654 r107671 49 49 #include <iprt/zip.h> 50 50 #include <iprt/asm.h> 51 #include <iprt/zero.h> 51 52 #ifdef RT_OS_WINDOWS 52 53 # include <iprt/utf16.h> … … 8653 8654 * of the image. 8654 8655 */ 8655 void *pvBuf = NULL, *pvZero = NULL; 8656 void *pvBuf = NULL; 8657 AssertCompile(sizeof(g_abRTZero4K) >= VMDK_GRAIN_TABLE_SIZE); 8656 8658 8657 8659 do … … 8661 8663 if (!pvBuf) 8662 8664 { 8663 rc = VERR_NO_MEMORY;8664 break;8665 }8666 8667 /* Allocate buffer for overwriting with zeroes. */8668 pvZero = RTMemAllocZ(VMDK_GRAIN_TABLE_SIZE);8669 if (!pvZero)8670 {8671 RTMemFree(pvBuf);8672 pvBuf = NULL;8673 8674 8665 rc = VERR_NO_MEMORY; 8675 8666 break; … … 8782 8773 } 8783 8774 8784 if (pvZero)8785 {8786 RTMemFree(pvZero);8787 pvZero = NULL;8788 }8789 8790 8775 pExtent->cGDEntries = cNewDirEntries; 8791 8792 /* Allocate buffer for overwriting with zeroes. */8793 pvZero = RTMemAllocZ(VMDK_GRAIN_TABLE_SIZE);8794 if (!pvZero)8795 return VERR_NO_MEMORY;8796 8776 8797 8777 // Allocate additional grain dir … … 8816 8796 8817 8797 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage, 8818 VMDK_SECTOR2BYTE(uTmpDirVal), pvZero,8798 VMDK_SECTOR2BYTE(uTmpDirVal), &g_abRTZero4K[0], 8819 8799 VMDK_GRAIN_TABLE_SIZE); 8820 8800 … … 8831 8811 8832 8812 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage, 8833 VMDK_SECTOR2BYTE(uRTmpDirVal), pvZero,8813 VMDK_SECTOR2BYTE(uRTmpDirVal), &g_abRTZero4K[0], 8834 8814 VMDK_GRAIN_TABLE_SIZE); 8835 8815 … … 8839 8819 uRTmpDirVal += VMDK_GRAIN_DIR_ENTRY_SIZE; 8840 8820 } 8841 8842 RTMemFree(pvZero);8843 pvZero = NULL;8844 8821 8845 8822 rc = vdIfIoIntFileWriteSync(pImage->pIfIo, pExtent->pFile->pStorage,
Note:
See TracChangeset
for help on using the changeset viewer.