From 96a2862cff4ae0309446d566d6e63cecef50e48c Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Wed, 17 Jan 2007 20:18:44 +0000 Subject: [PATCH] Bug 354307 - newInterface not freed if nsProxyObject::LockedFind fails, r=timeless --- xpcom/proxy/src/nsProxyEvent.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xpcom/proxy/src/nsProxyEvent.cpp b/xpcom/proxy/src/nsProxyEvent.cpp index 464c9dff9ef2..9fbc309cd7a6 100644 --- a/xpcom/proxy/src/nsProxyEvent.cpp +++ b/xpcom/proxy/src/nsProxyEvent.cpp @@ -431,8 +431,11 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult) peo = new nsProxyEventObject(this, pec, already_AddRefed(newInterface), &rv); - if (!peo) + if (!peo) { + NS_RELEASE(newInterface); return NS_ERROR_OUT_OF_MEMORY; + } + if (NS_FAILED(rv)) { delete peo; return rv;