From a347201a38180db57bd9abcb62877c4a348dfe7b Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Sun, 3 May 2015 13:46:00 -0400 Subject: [PATCH] Bug 1160428 - Fix theoretical take picture memory leak uncovered by coverity. r=aosmond --- dom/camera/DOMCameraControlListener.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/camera/DOMCameraControlListener.cpp b/dom/camera/DOMCameraControlListener.cpp index 7a586c4d6c2..25f2c6596f3 100644 --- a/dom/camera/DOMCameraControlListener.cpp +++ b/dom/camera/DOMCameraControlListener.cpp @@ -365,9 +365,16 @@ DOMCameraControlListener::OnTakePictureComplete(const uint8_t* aData, uint32_t a static_cast(mLength), mMimeType); aDOMCameraControl->OnTakePictureComplete(picture); + mData = NULL; } protected: + virtual + ~Callback() + { + free(mData); + } + uint8_t* mData; uint32_t mLength; nsString mMimeType;