summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 03:02:09 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-06 03:02:09 +0000
commitfcc001002706239b52108ea470855123c0daee63 (patch)
tree97b01ad46aed98a6e5dddb86f8a9c41950bd00b2 /ppapi
parent2b751a16c101c3e8505cca4a3e9fca7aaadfd630 (diff)
downloadchromium_src-fcc001002706239b52108ea470855123c0daee63.zip
chromium_src-fcc001002706239b52108ea470855123c0daee63.tar.gz
chromium_src-fcc001002706239b52108ea470855123c0daee63.tar.bz2
Prevent NaCl proxy from closing the handle by bumping the ref count.
It fixes a double close bug but also introduces a small memory leak. BUG=https://chromiumcodereview.appspot.com/9610008 TEST=Bastion Review URL: https://chromiumcodereview.appspot.com/9609018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc
index ba4d789..92648c3 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_graphics_3d_rpc_server.cc
@@ -387,7 +387,9 @@ void PpbGraphics3DRpcServer::PPB_Graphics3DTrusted_GetTransferBuffer(
GetTransferBuffer(resource_id, id, &native_handle, &native_size);
desc_wrapper.reset(factory.ImportShmHandle(
(NaClHandle)native_handle, native_size));
- *shm_desc = desc_wrapper->desc();
+ // todo(nfullagar): Dup the handle instead of leak caused by bumping the ref.
+ // bug: https://chromiumcodereview.appspot.com/9610008
+ *shm_desc = NaClDescRef(desc_wrapper->desc());
*shm_size = native_size;
rpc->result = NACL_SRPC_RESULT_OK;