Fix memory leaks

This commit is contained in:
Svetlana Kulikova
2024-07-29 17:56:48 +03:00
parent 0eb8c93cf9
commit 16ae48ef4e
8 changed files with 11 additions and 5 deletions

View File

@ -614,7 +614,6 @@ std::wstring CPdfReader::GetInfo()
std::wstring sRes = L"{";
Object oInfo;
m_pPDFDocument->getDocInfo(&oInfo);
if (m_pPDFDocument->getDocInfo(&oInfo)->isDict())
{
auto fDictLookup = [&oInfo](const char* sName, const wchar_t* wsName)
@ -953,6 +952,7 @@ BYTE* CPdfReader::GetLinks(int nPageIndex)
if (!sLink)
continue;
std::string link(sLink->getCString(), sLink->getLength());
RELEASEOBJECT(sLink);
size_t find = link.find("http://");
if (find == std::string::npos)
find = link.find("https://");
@ -966,6 +966,7 @@ BYTE* CPdfReader::GetLinks(int nPageIndex)
oLinks.m_arLinks.push_back({link, 0, x1, y1, x2 - x1, y2 - y1});
}
}
RELEASEOBJECT(pWordList);
RELEASEOBJECT(pTextOut);
return oLinks.Serialize();