p = Util_SafeStrdup(encodedMachineID);
if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, p)) {
- free(p);
+ Posix_Free(p);
}
machineID = Atomic_ReadPtr(&atomic);
p = Util_SafeStrdup(GetOldMachineID());
} else {
p = Str_SafeAsprintf(NULL, "uuid=%s", q);
- free(q);
+ Posix_Free(q);
/* Surpress any whitespace. */
for (q = p; *q; q++) {
}
if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, p)) {
- free(p);
+ Posix_Free(p);
}
machineID = Atomic_ReadPtr(&atomic);
}
}
result = Base64_Decode(q, rawMachineID_1, sizeof rawMachineID_1, &len);
- free(q);
+ Posix_Free(q);
if ((result == FALSE) || (len != 12)) {
Warning("%s: unexpected decode problem #1 (%s)\n", __FUNCTION__,
}
}
result = Base64_Decode(q, rawMachineID_2, sizeof rawMachineID_2, &len);
- free(q);
+ Posix_Free(q);
if ((result == FALSE) || (len != 12)) {
Warning("%s: unexpected decode problem #2 (%s)\n", __FUNCTION__,
break;
}
- free(dstFilename);
+ Posix_Free(dstFilename);
} else {
err = Err_Errno();
Msg_Append(MSGID(File.CopyTree.stat.failure)
Err_SetErrno(err);
}
- free(srcFilename);
+ Posix_Free(srcFilename);
}
Util_FreeStringList(fileList, numFiles);
"There is not enough space in the file system to "
"move the directory tree. Free %s and try again.",
spaceStr);
- free(spaceStr);
+ Posix_Free(spaceStr);
return FALSE;
}
}
char *fileName = File_PathJoin(pathName, fileList[i]);
int64 fileSize = File_GetSizeEx(fileName);
- free(fileName);
+ Posix_Free(fileName);
if (fileSize != -1) {
totalSize += fileSize;
index = Unicode_LengthInCodePoints(volume);
- free(volume);
+ Posix_Free(volume);
if (index >= length) {
return File_IsDirectory(pathName);
}
#endif
- free(temp);
+ Posix_Free(temp);
if (failed) {
return FALSE;
sawFileError = TRUE;
}
- free(curPath);
+ Posix_Free(curPath);
}
- free(base);
+ Posix_Free(base);
if (!contentOnly) {
/*
goto done;
}
- free(cur);
+ Posix_Free(cur);
cur = NULL;
if (full) {
break;
}
- free(cur);
+ Posix_Free(cur);
cur = NULL;
tok = strtok_r(NULL, FILE_SEARCHPATHTOKEN, &saveptr);
}
}
- free(cur);
+ Posix_Free(cur);
} else {
found = FALSE;
}
- free(sp);
- free(dir);
- free(file);
+ Posix_Free(sp);
+ Posix_Free(dir);
+ Posix_Free(file);
return found;
}
}
ASSERT(dst != fileName);
- free(dst);
+ Posix_Free(dst);
dst = src;
}
}
fileNumbers[nFound++] = curNr;
}
- free(fileList[i]);
+ Posix_Free(fileList[i]);
}
if (nFound > 0) {
}
if (newFilePath == NULL || result == -1) {
- free(tmp);
+ Posix_Free(tmp);
} else {
*newFilePath = tmp;
}
Log(LGPFX" %s: failed to remove %s: %s\n", __FUNCTION__, tmp,
Msg_ErrString());
}
- free(tmp);
+ Posix_Free(tmp);
}
}
cleanup:
- free(fileNumbers);
- free(fileList);
- free(fmtString);
- free(baseDir);
- free(baseName);
- free(fullPathNoExt);
+ Posix_Free(fileNumbers);
+ Posix_Free(fileList);
+ Posix_Free(fmtString);
+ Posix_Free(baseDir);
+ Posix_Free(baseName);
+ Posix_Free(fullPathNoExt);
}
FileRotateByRename(fileName, baseName, ext, n, newFileName);
}
- free(baseName);
+ Posix_Free(baseName);
}
}
}
- free(path);
- free(base);
+ Posix_Free(path);
+ Posix_Free(base);
return retValue;
}
/*********************************************************
- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
ASSERT(fd != NULL);
if (fd->fileName) {
- free(fd->fileName);
+ Posix_Free(fd->fileName);
fd->fileName = NULL;
}
}
}
}
- free(path);
+ Posix_Free(path);
return ret;
}
return NULL;
}
retPath = Unicode_Join(srcPath, "~", NULL);
- free(srcPath);
+ Posix_Free(srcPath);
return retPath;
}
}
#endif
- free(tempPath);
+ Posix_Free(tempPath);
return FILEIO_SUCCESS;
bail:
ASSERT(ret == 0);
#endif
}
- free(tempPath);
+ Posix_Free(tempPath);
return status;
}
}
swapdone:
- free(args);
- free(dirName);
- free(fileName);
- free(dstDirName);
- free(dstFileName);
- free(currPath);
- free(newPath);
+ Posix_Free(args);
+ Posix_Free(dirName);
+ Posix_Free(fileName);
+ Posix_Free(dstDirName);
+ Posix_Free(dstFileName);
+ Posix_Free(currPath);
+ Posix_Free(newPath);
errno = savedErrno;
return ret;
currFD->win32 = tmpFD.win32;
FileIO_Cleanup(&tmpFD);
- free(currPath);
- free(newPath);
+ Posix_Free(currPath);
+ Posix_Free(newPath);
errno = savedErrno;
return ret;
temp = Unicode_Substr(pathName, 0, index + 1);
path = Unicode_Append(temp, ".");
- free(temp);
+ Posix_Free(temp);
}
/*
*useProxy = TRUE;
}
- free(path);
+ Posix_Free(path);
return 0;
}
if (filePosixOptions.aligned || flags & FILEIO_OPEN_UNBUFFERED) {
FileIOAligned_Free(coVec->iov_base);
} else {
- free(coVec->iov_base);
+ Posix_Free(coVec->iov_base);
}
}
statBuf.f_type == EXT4_SUPER_MAGIC) {
ret = TRUE;
}
- free(fullPath);
+ Posix_Free(fullPath);
}
#endif
}
exit:
- free(lockFileName);
- free(lockFileLink);
+ Posix_Free(lockFileName);
+ Posix_Free(lockFileLink);
return status;
}
if (ret < 0) {
Log(LGPFX" Cannot remove lock file %s (%s).\n",
path, Err_Errno2String(saveErrno));
- free(path);
+ Posix_Free(path);
return FALSE;
}
- free(path);
+ Posix_Free(path);
return TRUE;
}
ASSERT(gotProcData); // We built it; it had better be good
ASSERT(procPID == filePID); // This better match what we started with...
- free(procDescriptor);
+ Posix_Free(procDescriptor);
if ((fileCreationTime != 0) &&
(procCreationTime != 0) &&
result = (fullPath == NULL) ? NULL : Unicode_Join(fullPath, DIRSEPS,
fileName, NULL);
- free(fullPath);
- free(dirName);
- free(fileName);
+ Posix_Free(fullPath);
+ Posix_Free(dirName);
+ Posix_Free(fileName);
return result;
}
tokenPtr = FileLockIntrinsic(normalizedPath, !readOnly, maxWaitTimeMsec,
&res);
- free(normalizedPath);
+ Posix_Free(normalizedPath);
}
if (err != NULL) {
} else {
isLocked = FileLockIsLocked(normalizedPath, &res);
- free(normalizedPath);
+ Posix_Free(normalizedPath);
}
if (err != NULL) {
}
}
- free(path);
+ Posix_Free(path);
return err;
}
Str_Strcpy(buffer, newBuffer, requiredSize);
- free(newBuffer);
+ Posix_Free(newBuffer);
goto fixedUp;
}
memberValues->lockType = argv[3];
memberValues->memberName = Unicode_Duplicate(fileName);
- free(path);
+ Posix_Free(path);
return 0;
}
bail:
- free(path);
+ Posix_Free(path);
return err;
}
}
#if defined(_WIN32)
- free(value);
+ Posix_Free(value);
#endif
return Str_SafeAsprintf(NULL, "%u", hash);
goto bail;
}
- free(fileList[i]);
+ Posix_Free(fileList[i]);
fileList[i] = NULL;
continue;
}
}
- free(fileList[i]);
+ Posix_Free(fileList[i]);
fileList[i] = NULL;
}
}
Log(LGPFX" %s discarding %s from %s': %s\n",
__FUNCTION__, fileList[i], lockDir, dispose);
- free(dispose);
- free(memberValues.memberName);
+ Posix_Free(dispose);
+ Posix_Free(memberValues.memberName);
err = FileLockRemoveLockingFile(lockDir, fileList[i]);
if (err != 0) {
err = (*func)(lockDir, fileList[i], ptr, myValues);
if (ptr == &memberValues) {
- free(memberValues.memberName);
+ Posix_Free(memberValues.memberName);
}
if (err != 0) {
Util_FreeStringList(fileList, numEntries);
- free(locationChecksum);
- free(myExecutionID);
+ Posix_Free(locationChecksum);
+ Posix_Free(myExecutionID);
return err;
}
temp = Unicode_Replace(path, index, 1, "M");
FileDeletionRobust(temp, FALSE);
- free(temp);
+ Posix_Free(temp);
temp = Unicode_Replace(path, index, 1, "E");
FileDeletionRobust(temp, FALSE);
- free(temp);
+ Posix_Free(temp);
FileRemoveDirectoryRobust(path);
- free(path);
+ Posix_Free(path);
remove = TRUE;
} else {
ptr = myValues->lockList;
myValues->lockList = ptr->next;
- free(ptr->dirName);
+ Posix_Free(ptr->dirName);
- free(ptr);
+ Posix_Free(ptr);
}
return err;
Log(LGPFX" %s failed for '%s': %s\n", __FUNCTION__,
tokenPtr->u.portable.lockFilePath, Err_Errno2String(err));
}
- free(lockDir);
- free(tokenPtr->u.portable.lockFilePath);
+ Posix_Free(lockDir);
+ Posix_Free(tokenPtr->u.portable.lockFilePath);
}
tokenPtr->u.portable.lockFilePath = NULL; // Just in case...
}
}
- free(tokenPtr->pathName);
+ Posix_Free(tokenPtr->pathName);
tokenPtr->signature = 0; // Just in case...
tokenPtr->pathName = NULL; // Just in case...
- free(tokenPtr);
+ Posix_Free(tokenPtr);
return err;
}
}
}
- free(path);
+ Posix_Free(path);
}
return err;
temp = Unicode_Format("D%05u%s", randomNumber, FILELOCK_SUFFIX);
*entryDirectory = Unicode_Join(lockDir, DIRSEPS, temp, NULL);
- free(temp);
+ Posix_Free(temp);
temp = Unicode_Format("E%05u%s", randomNumber, FILELOCK_SUFFIX);
*entryFilePath = Unicode_Join(lockDir, DIRSEPS, temp, NULL);
- free(temp);
+ Posix_Free(temp);
*memberFilePath = Unicode_Join(lockDir, DIRSEPS, *memberName, NULL);
}
}
- free(*entryDirectory);
- free(*entryFilePath);
- free(*memberFilePath);
- free(*memberName);
+ Posix_Free(*entryDirectory);
+ Posix_Free(*entryFilePath);
+ Posix_Free(*memberFilePath);
+ Posix_Free(*memberName);
*entryDirectory = NULL;
*entryFilePath = NULL;
}
if (err != 0) {
- free(*entryDirectory);
- free(*entryFilePath);
- free(*memberFilePath);
- free(*memberName);
+ Posix_Free(*entryDirectory);
+ Posix_Free(*entryFilePath);
+ Posix_Free(*memberFilePath);
+ Posix_Free(*memberName);
*entryDirectory = NULL;
*entryFilePath = NULL;
} else {
*err = FileMapErrorToErrno(__FUNCTION__, errnum);
}
- free(tokenPtr->pathName);
+ Posix_Free(tokenPtr->pathName);
ASSERT(!FileIO_IsValid(&tokenPtr->u.mandatory.lockFd));
- free(tokenPtr);
+ Posix_Free(tokenPtr);
return NULL;
}
bail:
- free(entryDirectory);
- free(entryFilePath);
+ Posix_Free(entryDirectory);
+ Posix_Free(entryFilePath);
if (*err == 0) {
tokenPtr = Util_SafeMalloc(sizeof *tokenPtr);
tokenPtr->pathName = Unicode_Duplicate(pathName);
tokenPtr->u.portable.lockFilePath = memberFilePath;
} else {
- free(memberFilePath);
+ Posix_Free(memberFilePath);
tokenPtr = NULL;
if (*err == EAGAIN) {
tokenPtr = FileLockIntrinsicPortable(pathName, lockBase, &myValues, err);
- free(myValues.memberName);
- free(myValues.locationChecksum);
- free(myValues.executionID);
+ Posix_Free(myValues.memberName);
+ Posix_Free(myValues.locationChecksum);
+ Posix_Free(myValues.executionID);
}
- free(lockBase);
+ Posix_Free(lockBase);
return tokenPtr;
}
isLocked = FileLockIsLockedPortable(lockBase, err);
}
- free(lockBase);
+ Posix_Free(lockBase);
return isLocked;
}
} else {
err = (Posix_Unlink(linkPath) == -1) ? errno : 0;
- free(linkPath);
+ Posix_Free(linkPath);
/* Ignore a file that has already disappeared */
if (err != ENOENT) {
break;
}
- free(buffer);
+ Posix_Free(buffer);
buffer = NULL;
if (errno != ERANGE) {
path = Unicode_Alloc(buffer, STRING_ENCODING_DEFAULT);
- free(buffer);
+ Posix_Free(buffer);
return path;
}
result = Unicode_AllocWithUTF8(path);
- free(path);
+ Posix_Free(path);
return result;
}
}
ret = Unicode_Join(realDir, DIRSEPS, file, NULL);
- free(dir);
- free(file);
- free(realDir);
+ Posix_Free(dir);
+ Posix_Free(file);
+ Posix_Free(realDir);
}
- free(path);
+ Posix_Free(path);
}
- free(cwd);
+ Posix_Free(cwd);
return ret;
}
if (err != 0) {
Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__,
pathName, Err_Errno2String(err));
- free(path);
+ Posix_Free(path);
return FALSE;
}
err = (utimes(path, times) == -1) ? errno : 0;
- free(path);
+ Posix_Free(path);
if (err != 0) {
Log(LGPFX" %s: utimes error on file \"%s\": %s\n", __FUNCTION__,
File_GetPathName(*canPath, &pathName, &baseName);
- free(*canPath);
+ Posix_Free(*canPath);
if (Unicode_IsEmpty(pathName)) {
/* empty string which denotes "/" */
- free(pathName);
+ Posix_Free(pathName);
*canPath = Unicode_Duplicate("/");
} else {
if (Unicode_IsEmpty(baseName)) { // Directory
File_GetPathName(pathName, canPath, NULL);
- free(pathName);
+ Posix_Free(pathName);
} else { // File
*canPath = pathName;
}
}
- free(baseName);
+ Posix_Free(baseName);
return FALSE;
}
FilePosixGetParent(&dupPath);
}
- free(dupPath);
+ Posix_Free(dupPath);
return retval;
}
ret = -1;
}
- free(fullPath);
+ Posix_Free(fullPath);
return ret;
}
Log(LGPFX" %s: could not open %s: %s\n", __func__, pathName,
Err_Errno2String(errno));
ret = -1;
- free(*fsAttrs);
+ Posix_Free(*fsAttrs);
*fsAttrs = NULL;
goto bail;
}
if (ret == -1) {
Log(LGPFX" %s: Could not get volume attributes (ret = %d): %s\n",
__func__, ret, Err_Errno2String(errno));
- free(*fsAttrs);
+ Posix_Free(*fsAttrs);
*fsAttrs = NULL;
}
close(fd);
bail:
- free(fullPath);
- free(directory);
+ Posix_Free(fullPath);
+ Posix_Free(directory);
return ret;
}
}
if (fsAttrs) {
- free(fsAttrs);
+ Posix_Free(fsAttrs);
}
exit:
}
if (fsAttrs) {
- free(fsAttrs);
+ Posix_Free(fsAttrs);
}
exit:
*remoteMountPoint = NULL;
}
- free(fsAttrs);
+ Posix_Free(fsAttrs);
}
return ret;
}
if (fsAttrs) {
- free(fsAttrs);
+ Posix_Free(fsAttrs);
}
#endif
}
File_GetPathName(fullPath, &dir, NULL);
res = File_GetVMFSFSType(dir, -1, &fsTypeNum);
- free(tempPath);
- free(dir);
+ Posix_Free(tempPath);
+ Posix_Free(dir);
return (res == 0) ? IS_VMFS_FSTYPENUM(fsTypeNum) : FALSE;
#else
ret = -1;
}
- free(fullPath);
+ Posix_Free(fullPath);
return ret;
}
char devfsName[FILE_MAXPATH];
if (sscanf(existPath, DEVFS_MOUNT_PATH "%[^/]%*s", devfsName) == 1) {
- free(existPath);
- free(canPath);
+ Posix_Free(existPath);
+ Posix_Free(canPath);
return Str_SafeAsprintf(NULL, "%s/%s", DEVFS_MOUNT_POINT, devfsName);
}
}
- free(existPath);
+ Posix_Free(existPath);
if (canPath == NULL) {
return NULL;
*/
if (strncmp(canPath, VCFS_MOUNT_POINT, strlen(VCFS_MOUNT_POINT)) != 0 ||
sscanf(canPath, VCFS_MOUNT_PATH "%[^/]%*s", vmfsVolumeName) != 1) {
- free(canPath);
+ Posix_Free(canPath);
goto exit;
}
unique = Str_SafeAsprintf(NULL, "%s/%s/%s",
VCFS_MOUNT_POINT, vmfsVolumeName,
fsAttrs->name);
- free(fsAttrs);
- free(canPath);
+ Posix_Free(fsAttrs);
+ Posix_Free(canPath);
return unique;
}
- free(fsAttrs);
+ Posix_Free(fsAttrs);
}
- free(canPath);
+ Posix_Free(canPath);
return Str_SafeAsprintf(NULL, "%s/%s", VCFS_MOUNT_POINT,
vmfsVolumeName);
!mnt.mnt_type || !mnt.mnt_opts) {
size += 4 * FILE_MAXPATH;
ASSERT(size <= 32 * FILE_MAXPATH);
- free(buf);
+ Posix_Free(buf);
endmntent(f);
goto retry;
}
// 'canPath' is not a mount point.
endmntent(f);
- free(buf);
+ Posix_Free(buf);
return ret;
#endif
#if defined(__APPLE__)
failed = statfs(existPath, &buf) == -1;
- free(existPath);
+ Posix_Free(existPath);
if (failed) {
return NULL;
}
return Util_SafeStrdup(buf.f_mntfromname);
#else
realPath = Posix_RealPath(existPath);
- free(existPath);
+ Posix_Free(existPath);
if (realPath == NULL) {
return NULL;
}
Str_Strcpy(canPath, realPath, sizeof canPath);
- free(realPath);
+ Posix_Free(realPath);
retry:
Str_Strcpy(canPath2, canPath, sizeof canPath2);
Str_Strcpy(canPath, ptr, sizeof canPath);
}
- free(ptr);
+ Posix_Free(ptr);
/*
* There could be a series of these chained together. It is
x = Util_SafeStrdup(canPath);
failed = FilePosixGetParent(&x);
Str_Strcpy(canPath, x, sizeof canPath);
- free(x);
+ Posix_Free(x);
/*
* Prevent an infinite loop in case FilePosixLookupMountPoint() even
result = TRUE;
bail:
- free(newPath);
- free(oldPath);
+ Posix_Free(newPath);
+ Posix_Free(oldPath);
errno = status;
temp = Unicode_Append(dirName, "/.vmBigFileTest");
posixFD = File_MakeSafeTemp(temp, &path);
- free(temp);
+ Posix_Free(temp);
if (posixFD == -1) {
Log(LGPFX" %s: Failed to create temporary file in dir: %s\n", __func__,
FileIO_Close(&fd);
File_Unlink(path);
- free(path);
+ Posix_Free(path);
return retVal;
}
close(fd);
bail:
- free(fullPath);
- free(dirPath);
+ Posix_Free(fullPath);
+ Posix_Free(dirPath);
return retval;
}
} else {
Log(LGPFX" %s: Unsupported filesystem version, %u\n", __func__,
fsAttrs->versionNumber);
- free(fsAttrs);
+ Posix_Free(fsAttrs);
return FALSE;
}
- free(fsAttrs);
+ Posix_Free(fsAttrs);
if (maxFileSize == -1) {
Log(LGPFX" %s: Failed to figure out the max file size for %s\n",
__func__, pathName);
if (fullPath == NULL) {
Log(LGPFX" %s: Error acquiring full path\n", __func__);
- free(fsAttrs);
+ Posix_Free(fsAttrs);
return FALSE;
}
fileSize,
getMaxFileSize);
- free(fsAttrs);
- free(fullPath);
- free(parentPath);
+ Posix_Free(fsAttrs);
+ Posix_Free(fullPath);
+ Posix_Free(parentPath);
return supported;
}
retval = FilePosixCreateTestGetMaxOrSupportsFileSize(folderPath, fileSize,
getMaxFileSize);
- free(folderPath);
+ Posix_Free(folderPath);
out:
- free(fullPath);
+ Posix_Free(fullPath);
return retval;
}
void *value, // IN:
void *clientData) // IN:
{
- free((void *) key);
+ Posix_Free((void *) key);
return 0;
}
Warning("%s: file '%s' in directory '%s' cannot be converted to "
"UTF8\n", __FUNCTION__, pathName, id);
- free(id);
+ Posix_Free(id);
id = Unicode_Duplicate(UNICODE_SUBSTITUTION_CHAR
UNICODE_SUBSTITUTION_CHAR
if (HashTable_Insert(hash, id, NULL)) {
count++;
} else {
- free(id);
+ Posix_Free(id);
}
} else {
count++;
if (context->cnt > 0) {
Util_FreeStringList(context->files, context->cnt);
}
- free(context);
+ Posix_Free(context);
}
}
ret = FALSE;
end:
- free(members);
+ Posix_Free(members);
return ret;
}
/*********************************************************
- * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
if (volume) {
*volume = vol;
} else {
- free(vol);
+ Posix_Free(vol);
}
if (directory) {
*directory = dir;
} else {
- free(dir);
+ Posix_Free(dir);
}
if (base) {
*base = bas;
} else {
- free(bas);
+ Posix_Free(bas);
}
}
newDir = File_StripSlashes(dirName);
result = Unicode_Join(newDir, DIRSEPS, baseName, NULL);
- free(newDir);
+ Posix_Free(newDir);
return result;
}
File_SplitName(fullPath, &volume, pathName, baseName);
if (pathName == NULL) {
- free(volume);
+ Posix_Free(volume);
return;
}
if (!Unicode_IsEmpty(volume)) {
char *temp = Unicode_Append(volume, *pathName);
- free(*pathName);
+ Posix_Free(*pathName);
*pathName = temp;
}
- free(volume);
+ Posix_Free(volume);
/*
* Remove any trailing directory separator characters.
if (curLen < len) {
char *temp = Unicode_Substr(*pathName, 0, curLen);
- free(*pathName);
+ Posix_Free(*pathName);
*pathName = temp;
}
}
i--;
}
- free(dir);
+ Posix_Free(dir);
dir = Unicode_AllocWithLength(dir2, i, STRING_ENCODING_UTF8);
- free(dir2);
+ Posix_Free(dir2);
}
result = Unicode_Join(volume, dir, base, NULL);
- free(volume);
- free(dir);
- free(base);
+ Posix_Free(volume);
+ Posix_Free(dir);
+ Posix_Free(base);
return result;
}
* aren't allowed.
*/
- free(oldPrefix);
- free(newPrefix);
+ Posix_Free(oldPrefix);
+ Posix_Free(newPrefix);
return newPath;
}
- free(oldPrefix);
- free(newPrefix);
+ Posix_Free(oldPrefix);
+ Posix_Free(newPrefix);
}
return NULL;
}
if (oldBase != base) {
- free(oldBase);
+ Posix_Free(oldBase);
}
}
result = Unicode_Join(path, DIRSEPS, base, newExtension, NULL);
}
- free(path);
- free(base);
+ Posix_Free(path);
+ Posix_Free(base);
return result;
}
/*********************************************************
- * Copyright (C) 2011-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
char *fileName;
/* construct suffixed pathname to use */
- free(path);
+ Posix_Free(path);
path = NULL;
/*
/* construct base full pathname to use */
path = Unicode_Join(dir, DIRSEPS, fileName, NULL);
- free(fileName);
+ Posix_Free(fileName);
if (createTempFile) {
fd = Posix_Open(path, O_CREAT | O_EXCL | O_BINARY | O_RDWR, 0600);
}
exit:
- free(path);
+ Posix_Free(path);
return fd;
}
File_MakeTempEx2(dir, FALSE, FileMakeTempExCreateNameFunc,
(void *) effectivePrefix, &result);
- free(dir);
+ Posix_Free(dir);
}
return result;
fd = File_MakeTempEx(dir, fileName, presult);
- free(dir);
- free(fileName);
+ Posix_Free(dir);
+ Posix_Free(fileName);
return fd;
}
succeeded = TRUE;
exit:
- free(vol);
- free(vol2);
+ Posix_Free(vol);
+ Posix_Free(vol2);
#endif
return succeeded;
/*********************************************************
- * Copyright (C) 2004-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2004-2017 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
return edirName;
}
- free(edirName);
+ Posix_Free(edirName);
}
return NULL;
if (useConf) {
dirName = (char *)LocalConfig_GetString(NULL, "tmpDirectory");
edirName = FileTryDir(dirName);
- free(dirName);
+ Posix_Free(dirName);
if (edirName != NULL) {
return edirName;
}
if (dirName != NULL) {
edirName = FileTryDir(dirName);
- free(dirName);
+ Posix_Free(dirName);
if (edirName != NULL) {
return edirName;
}
if ((Posix_Getpwuid_r(uid, &pw, memPool, memPoolSize, &pw_p) != 0) ||
pw_p == NULL) {
- free(memPool);
+ Posix_Free(memPool);
Warning("%s: Unable to retrieve the username associated with "
"user ID %u.\n", __FUNCTION__, uid);
}
userName = strdup(pw_p->pw_name);
- free(memPool);
+ Posix_Free(memPool);
if (userName == NULL) {
Warning("%s: Not enough memory.\n", __FUNCTION__);
numFiles = File_ListDirectory(baseTmpDir, &fileList);
if (numFiles == -1) {
- free(pattern);
+ Posix_Free(pattern);
return NULL;
}
break;
}
- free(path);
+ Posix_Free(path);
}
}
Util_FreeStringList(fileList, numFiles);
- free(pattern);
+ Posix_Free(pattern);
return tmpDir;
}
Warning("%s: Failed to create a safe temporary directory, path "
"\"%s\". The maximum number of attempts was exceeded.\n",
__FUNCTION__, tmpDir);
- free(tmpDir);
+ Posix_Free(tmpDir);
tmpDir = NULL;
break;
}
- free(tmpDir);
+ Posix_Free(tmpDir);
tmpDir = NULL;
}
* an acceptable one to use.
*/
- free(tmpDir);
+ Posix_Free(tmpDir);
tmpDir = FileFindExistingSafeTmpDir(userId, userName, baseTmpDir);
* future calls.
*/
- free(safeDir);
+ Posix_Free(safeDir);
safeDir = Util_SafeStrdup(tmpDir);
}
exit:
MXUser_ReleaseExclLock(lck);
- free(baseTmpDir);
- free(userName);
+ Posix_Free(baseTmpDir);
+ Posix_Free(userName);
#endif
return tmpDir;