mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-20 23:24:34 +00:00
loolwsd: deallocates memory previously allocated by malloc
This commit is contained in:
@ -695,7 +695,10 @@ bool ChildSession::getCommandValues(const char* /*buffer*/, int /*length*/, Stri
|
||||
if (_multiView)
|
||||
_loKitDocument->setView(_viewId);
|
||||
|
||||
return sendTextFrame("commandvalues: " + std::string(_loKitDocument->getCommandValues(command.c_str())));
|
||||
char* ptrValues = _loKitDocument->getCommandValues(command.c_str());
|
||||
bool success = sendTextFrame("commandvalues: " + std::string(ptrValues));
|
||||
std::free(ptrValues);
|
||||
return success;
|
||||
}
|
||||
|
||||
bool ChildSession::getPartPageRectangles(const char* /*buffer*/, int /*length*/)
|
||||
|
@ -107,6 +107,7 @@ namespace LOKitHelper
|
||||
inline
|
||||
std::string documentStatus(LibreOfficeKitDocument *loKitDocument)
|
||||
{
|
||||
char* ptrValue;
|
||||
assert(loKitDocument && "null loKitDocument");
|
||||
const auto type = static_cast<LibreOfficeKitDocumentType>(loKitDocument->pClass->getDocumentType(loKitDocument));
|
||||
|
||||
@ -128,11 +129,15 @@ namespace LOKitHelper
|
||||
oss << "\n";
|
||||
if (type == LOK_DOCTYPE_PRESENTATION)
|
||||
{
|
||||
oss << loKitDocument->pClass->getPartHash(loKitDocument, i);
|
||||
ptrValue = loKitDocument->pClass->getPartHash(loKitDocument, i);
|
||||
oss << ptrValue;
|
||||
std::free(ptrValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << loKitDocument->pClass->getPartName(loKitDocument, i);
|
||||
ptrValue = loKitDocument->pClass->getPartName(loKitDocument, i);
|
||||
oss << ptrValue;
|
||||
std::free(ptrValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user