From 86853c6e1768fc5e6aa86454f60d4a4b976ee290 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 19 Dec 2004 13:06:35 +0000 Subject: Fix a mem leak --- embed/mozilla/MozRegisterComponents.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp index 2da1c541a..aa06d9353 100644 --- a/embed/mozilla/MozRegisterComponents.cpp +++ b/embed/mozilla/MozRegisterComponents.cpp @@ -77,12 +77,14 @@ RegisterContentPolicy(nsIComponentManager *aCompMgr, nsIFile *aPath, do_GetService(NS_CATEGORYMANAGER_CONTRACTID); NS_ENSURE_TRUE (cm, NS_ERROR_FAILURE); + nsresult rv; char *oldval; - return cm->AddCategoryEntry("content-policy", - EPHY_CONTENT_POLICY_CONTRACTID, - EPHY_CONTENT_POLICY_CONTRACTID, - PR_TRUE, PR_TRUE, &oldval); + rv = cm->AddCategoryEntry ("content-policy", + EPHY_CONTENT_POLICY_CONTRACTID, + EPHY_CONTENT_POLICY_CONTRACTID, + PR_TRUE, PR_TRUE, &oldval); nsMemory::Free (oldval); + return rv; } static const nsModuleComponentInfo sAppComps[] = { -- cgit