diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index f4bec243a0d..7e5a3c6d4a4 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -425,6 +425,8 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) receiver->AddEventListener(type, (nsIDOMMouseListener*)handler, useCapture); else receiver->AddEventListener(type, (nsIDOMKeyListener*)handler, useCapture); + + NS_RELEASE(handler); } // XXX Call AddScriptEventListener for other IID types diff --git a/layout/xbl/src/nsXBLBinding.cpp b/layout/xbl/src/nsXBLBinding.cpp index f4bec243a0d..7e5a3c6d4a4 100644 --- a/layout/xbl/src/nsXBLBinding.cpp +++ b/layout/xbl/src/nsXBLBinding.cpp @@ -425,6 +425,8 @@ nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement) receiver->AddEventListener(type, (nsIDOMMouseListener*)handler, useCapture); else receiver->AddEventListener(type, (nsIDOMKeyListener*)handler, useCapture); + + NS_RELEASE(handler); } // XXX Call AddScriptEventListener for other IID types