diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 19:09:51 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 19:09:51 +0000 |
commit | 2b79be4d4cc515e8ab45901fb5a95a2980a45585 (patch) | |
tree | caec89229d37efcfe551a5cb90f37d8896dd3bbc /chrome/browser/extensions | |
parent | cb91fa208d1c5d98a8c0cd2dde26cdb225fec929 (diff) | |
download | chromium_src-2b79be4d4cc515e8ab45901fb5a95a2980a45585.zip chromium_src-2b79be4d4cc515e8ab45901fb5a95a2980a45585.tar.gz chromium_src-2b79be4d4cc515e8ab45901fb5a95a2980a45585.tar.bz2 |
Coverity: Fix memleak in GetNodeDictionary again.
CID=4804
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/246025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27523 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_bookmarks_module.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc index f06a19e..4bef0f2 100644 --- a/chrome/browser/extensions/extension_bookmarks_module.cc +++ b/chrome/browser/extensions/extension_bookmarks_module.cc @@ -52,7 +52,7 @@ class ExtensionBookmarks { floor(node->date_added().ToDoubleT() * 1000)); } - if (recurse) { + if (recurse && node->is_folder()) { int childCount = node->GetChildCount(); ListValue* children = new ListValue(); for (int i = 0; i < childCount; ++i) { @@ -60,8 +60,7 @@ class ExtensionBookmarks { DictionaryValue* dict = GetNodeDictionary(child, true); children->Append(dict); } - if (node->is_folder()) - dict->Set(keys::kChildrenKey, children); + dict->Set(keys::kChildrenKey, children); } return dict; } |