summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 20:04:01 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-24 20:04:01 +0000
commit0a7bd21a45d40c91b408e19c7dada3e29d59c707 (patch)
tree782944c83d4a185be7061848bce3465bd43bf5ea /net
parentf06e54d0eccbb4df6ea4f0e13f95565760e54ce0 (diff)
downloadchromium_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-xnet/flip/flip_stream.cc8
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_)