summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:16:42 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:16:42 +0000
commit2e7c2aa7179907202155d4714913e0a0724e11a5 (patch)
tree8fa1e1bfcc8b79f53c74dba01dee0cb971911d4b
parent360a25d4fa94f194d9844f4bb964ab6e6bc82eac (diff)
downloadchromium_src-2e7c2aa7179907202155d4714913e0a0724e11a5.zip
chromium_src-2e7c2aa7179907202155d4714913e0a0724e11a5.tar.gz
chromium_src-2e7c2aa7179907202155d4714913e0a0724e11a5.tar.bz2
Fix valgrind / heapcheck error in 51743
Handles to the sync socket should be released. The leak of 4 bytes apprantly is the leaked SyncSocket object. BUG=51743 TBR=cbentzel Review URL: http://codereview.chromium.org/2818047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51784 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_host/audio_sync_reader.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/audio_sync_reader.cc b/chrome/browser/renderer_host/audio_sync_reader.cc
index 1cccfbe..48787e7 100644
--- a/chrome/browser/renderer_host/audio_sync_reader.cc
+++ b/chrome/browser/renderer_host/audio_sync_reader.cc
@@ -47,11 +47,8 @@ bool AudioSyncReader::PrepareForeignSocketHandle(
::DuplicateHandle(GetCurrentProcess(), foreign_socket_->handle(),
process_handle, foreign_handle,
0, FALSE, DUPLICATE_SAME_ACCESS);
- if (*foreign_handle != 0) {
- // Note that this is just a way to get away with the unused variable
- // warning. We want to return true here.
- return foreign_socket_.release() != NULL;
- }
+ if (*foreign_handle != 0)
+ return true;
return false;
}
#else
@@ -60,11 +57,8 @@ bool AudioSyncReader::PrepareForeignSocketHandle(
base::FileDescriptor* foreign_handle) {
foreign_handle->fd = foreign_socket_->handle();
foreign_handle->auto_close = false;
- if (foreign_handle->fd != -1) {
- // Note that this is just a way to get away with the unused variable
- // warning. We want to return true here.
- return foreign_socket_.release() != NULL;
- }
+ if (foreign_handle->fd != -1)
+ return true;
return false;
}
#endif