From f94e823dfcd3d3659723a3a5605d5712c6344393 Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Sun, 15 May 2011 20:29:19 -0400 Subject: [PATCH] Bug 656991 - Fix leak in nsStructuredCloneContainer::InitFromVariant. r=bz,igor --- dom/base/nsStructuredCloneContainer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/base/nsStructuredCloneContainer.cpp b/dom/base/nsStructuredCloneContainer.cpp index cbbf18fe7c6..84899148639 100644 --- a/dom/base/nsStructuredCloneContainer.cpp +++ b/dom/base/nsStructuredCloneContainer.cpp @@ -97,6 +97,7 @@ nsStructuredCloneContainer::InitFromVariant(nsIVariant *aData, JSContext *aCx) if (!mData) { mSize = 0; mVersion = 0; + free(jsBytes); return NS_ERROR_FAILURE; } else { @@ -104,6 +105,7 @@ nsStructuredCloneContainer::InitFromVariant(nsIVariant *aData, JSContext *aCx) } memcpy(mData, jsBytes, mSize); + free(jsBytes); return NS_OK; }