Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2242)

Unified Diff: core/fpdfdoc/cpdf_interform.cpp

Issue 2376193002: Fix leaks in CFieldTree::Node. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_interform.cpp
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index d2a842262eabafe645a9735a20c12128c2040fb3..13d743cb52182cd0090c7fccaeb35a093968b03e 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -428,7 +428,6 @@ class CFieldTree {
return m_pField;
--*pFieldsToGo;
- return nullptr;
}
for (size_t i = 0; i < GetChildrenCount(); ++i) {
CPDF_FormField* pField = GetChildAt(i)->GetFieldInternal(pFieldsToGo);
@@ -441,10 +440,11 @@ class CFieldTree {
size_t CountFieldsInternal(int nLevel) const {
if (nLevel > nMaxRecursion)
return 0;
- if (m_pField)
- return 1;
size_t count = 0;
+ if (m_pField)
+ ++count;
+
for (size_t i = 0; i < GetChildrenCount(); ++i)
count += GetChildAt(i)->CountFieldsInternal(nLevel + 1);
return count;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698