diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 20:04:01 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 20:04:01 +0000 |
commit | 0a7bd21a45d40c91b408e19c7dada3e29d59c707 (patch) | |
tree | 782944c83d4a185be7061848bce3465bd43bf5ea /net | |
parent | f06e54d0eccbb4df6ea4f0e13f95565760e54ce0 (diff) | |
download | chromium_src-0a7bd21a45d40c91b408e19c7dada3e29d59c707.zip chromium_src-0a7bd21a45d40c91b408e19c7dada3e29d59c707.tar.gz chromium_src-0a7bd21a45d40c91b408e19c7dada3e29d59c707.tar.bz2 |
Flip: Fix leak of UploadDataStream if it's empty.
Review URL: http://codereview.chromium.org/434043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rwxr-xr-x | net/flip/flip_stream.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/flip/flip_stream.cc b/net/flip/flip_stream.cc index b9d8cc4..b0c7236 100755 --- a/net/flip/flip_stream.cc +++ b/net/flip/flip_stream.cc @@ -118,8 +118,12 @@ int FlipStream::SendRequest(UploadDataStream* upload_data, CHECK(callback); CHECK(!cancelled_); - if (upload_data && upload_data->size()) - request_body_stream_.reset(upload_data); + if (upload_data) { + if (upload_data->size()) + request_body_stream_.reset(upload_data); + else + delete upload_data; + } DCHECK_EQ(io_state_, STATE_NONE); if (!pushed_) |