diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 15:20:34 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-04 15:20:34 +0000 |
commit | 6b1e18a560171f38573600d1706bf7959d381150 (patch) | |
tree | 61c8160d063884dfc3ac8110a593671885a42608 /chrome/browser/bookmarks/bookmark_codec.h | |
parent | e9051d2443755028d9f9ac4c9a6accbe6b150a21 (diff) | |
download | chromium_src-6b1e18a560171f38573600d1706bf7959d381150.zip chromium_src-6b1e18a560171f38573600d1706bf7959d381150.tar.gz chromium_src-6b1e18a560171f38573600d1706bf7959d381150.tar.bz2 |
Fixing potential memory leak in BookmarkCodec::DecodeNode.
Coverity finds a condition where this leaks. We are at the moment not using it in such a way that it leaks, but that might of course change. It looks to me like the API is not intended to be used in such a way anyway, so we can just check for it and return false.
BUG=15350
TEST=Decoding bookmarks should work as before.
Review URL: http://codereview.chromium.org/159075
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_codec.h')
-rw-r--r-- | chrome/browser/bookmarks/bookmark_codec.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/bookmarks/bookmark_codec.h b/chrome/browser/bookmarks/bookmark_codec.h index becdf4e..25e9cb0 100644 --- a/chrome/browser/bookmarks/bookmark_codec.h +++ b/chrome/browser/bookmarks/bookmark_codec.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -109,7 +109,8 @@ class BookmarkCodec { // Decodes the supplied node from the supplied value. Child nodes are // created appropriately by way of DecodeChildren. If node is NULL a new - // node is created and added to parent, otherwise node is used. + // node is created and added to parent (parent must then be non-NULL), + // otherwise node is used. bool DecodeNode(const DictionaryValue& value, BookmarkNode* parent, BookmarkNode* node); |