Changeset 59609 in vbox
- Timestamp:
- Feb 8, 2016 8:56:14 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/VMDK.cpp
r59455 r59609 1022 1022 int rc = VINF_SUCCESS; 1023 1023 size_t cbGD = pExtent->cGDEntries * sizeof(uint32_t); 1024 /** @todo r=bird: This code is unnecessarily confusing pointer states with 1025 * (1) unnecessary initialization of locals, (2) unnecesarily wide 1026 * scoping of variables, (3) instance on goto code structure. Also, 1027 * having two initialized variables on one line decreases readability. */ 1024 1028 uint32_t *pGD = NULL, *pRGD = NULL; 1025 1029 … … 1365 1369 } 1366 1370 1371 /** 1372 * @param ppszUnquoted Where to store the return value, use RTMemTmpFree to 1373 * free. 1374 */ 1367 1375 static int vmdkStringUnquote(PVMDKIMAGE pImage, const char *pszStr, 1368 1376 char **ppszUnquoted, char **ppszNext) … … 1568 1576 } 1569 1577 1578 /** 1579 * @param ppszValue Where to store the return value, use RTMemTmpFree to 1580 * free. 1581 */ 1570 1582 static int vmdkDescBaseGetStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor, 1571 const char *pszKey, c onst char **ppszValue)1583 const char *pszKey, char **ppszValue) 1572 1584 { 1573 1585 const char *pszValue; … … 1701 1713 } 1702 1714 1715 /** 1716 * @param ppszValue Where to store the return value, use RTMemTmpFree to 1717 * free. 1718 */ 1703 1719 static int vmdkDescDDBGetStr(PVMDKIMAGE pImage, PVMDKDESCRIPTOR pDescriptor, 1704 const char *pszKey, c onst char **ppszValue)1720 const char *pszKey, char **ppszValue) 1705 1721 { 1706 1722 const char *pszValue; … … 2049 2065 2050 2066 /* Get image creation type and determine image flags. */ 2051 c onst char *pszCreateType = NULL; /* initialized to make gcc shut up */2067 char *pszCreateType = NULL; /* initialized to make gcc shut up */ 2052 2068 rc = vmdkDescBaseGetStr(pImage, &pImage->Descriptor, "createType", 2053 2069 &pszCreateType); … … 2064 2080 else if (!strcmp(pszCreateType, "vmfs")) 2065 2081 pImage->uImageFlags |= VD_IMAGE_FLAGS_FIXED | VD_VMDK_IMAGE_FLAGS_ESX; 2066 RT StrFree((char *)(void *)pszCreateType);2082 RTMemTmpFree(pszCreateType); 2067 2083 2068 2084 /* Count the number of extent config entries. */ … … 3670 3686 char *pszBasename = (char *)RTMemTmpAlloc(cbTmp); 3671 3687 if (!pszBasename) 3688 { 3689 RTStrFree(pszTmp); 3672 3690 return VERR_NO_MEMORY; 3691 } 3673 3692 memcpy(pszBasename, pszTmp, cbTmp); 3674 3693 RTStrFree(pszTmp); … … 6243 6262 if (pImage) 6244 6263 { 6245 c onst char *pszCommentEncoded = NULL;6264 char *pszCommentEncoded = NULL; 6246 6265 rc = vmdkDescDDBGetStr(pImage, &pImage->Descriptor, 6247 6266 "ddb.comment", &pszCommentEncoded); … … 6259 6278 rc = VINF_SUCCESS; 6260 6279 } 6261 if (pszCommentEncoded) 6262 RTStrFree((char *)(void *)pszCommentEncoded); 6280 RTMemTmpFree(pszCommentEncoded); 6263 6281 } 6264 6282 else
Note:
See TracChangeset
for help on using the changeset viewer.