fileLength = strlen(appIdPath.get()) + 29;
pFileName = (char*)malloc(fileLength);
+ SysTryCatch(NID_SYS, pFileName, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "It is not enough memory.");
+
ret = sprintf(pFileName, "/tmp/size_of_directory_%s.tmp", appIdPath.get());
SysTryCatch(NID_SYS, ret > 0, E_SYSTEM, E_SYSTEM, "It is failed to write file path.");
commandLength = strlen(pFileName) + 8;
pCommand = (char*) malloc(commandLength);
+ SysTryCatch(NID_SYS, pCommand, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "It is not enough memory.");
+
ret = sprintf(pCommand, "rm -rf %s", pFileName);
SysTryCatch(NID_SYS, ret > 0, E_SYSTEM, E_SYSTEM, "It is failed to write remove pCommand.");
commandLength = strlen(pFileName) + strlen(path) + 16;
pCommand = (char*)malloc(commandLength);
+ SysTryCatch(NID_SYS, pCommand, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "It is not enough memory.");
+
ret = sprintf(pCommand, "du -skb -P %s >> %s", path, pFileName);
SysTryCatch(NID_SYS, ret > 0, E_SYSTEM, E_SYSTEM, "It is failed to write du pCommand.");
}
if (pCommand)
{
- free(pFileName);
+ free(pCommand);
}
if (pFile)
{