Bug 1318132 - Fix CamerasChild helper to return by value instead of out-of-scope reference (Coverity) draft
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 16 Nov 2016 17:09:14 -0500
changeset 439953 ce2e343f9398b3aaef1256a1983d2b8da3fcf00a
parent 439734 51750761f2c61c64cf0553f6cb5fefd4999d3bc0
child 537295 ea72ba13d3aae489473af82ca19dce50bc6b6590
push id36142
push userjbruaroey@mozilla.com
push dateWed, 16 Nov 2016 22:10:11 +0000
bugs1318132
milestone53.0a1
Bug 1318132 - Fix CamerasChild helper to return by value instead of out-of-scope reference (Coverity) MozReview-Commit-ID: 5RQodJ18MbA
dom/media/systemservices/CamerasChild.cpp
--- a/dom/media/systemservices/CamerasChild.cpp
+++ b/dom/media/systemservices/CamerasChild.cpp
@@ -217,17 +217,17 @@ public:
       mReplyLock(aCamerasChild->mReplyMonitor),
       mRequestLock(aCamerasChild->mRequestMutex),
       mSuccess(true),
       mFailureValue(aFailureValue), mSuccessValue(aSuccessValue)
   {
     Dispatch();
   }
 
-  const T& ReturnValue() const {
+  T ReturnValue() const {
     if (mSuccess) {
       return mSuccessValue;
     } else {
       return mFailureValue;
     }
   }
 
   const bool& Success() const {