diff --git a/mozilla/layout/html/forms/src/nsInputFile.cpp b/mozilla/layout/html/forms/src/nsInputFile.cpp
index 6bd25f36ee0..107d78d893d 100644
--- a/mozilla/layout/html/forms/src/nsInputFile.cpp
+++ b/mozilla/layout/html/forms/src/nsInputFile.cpp
@@ -310,11 +310,14 @@ NS_NewHTMLInputFile(nsIHTMLContent** aInstancePtrResult,
return NS_ERROR_OUT_OF_MEMORY;
}
inputFile->AppendChild(child, PR_FALSE);
+ NS_RELEASE(child);
+
status = NS_NewHTMLInputBrowse(&child, aTag, aManager);
if (NS_OK != status) {
return NS_ERROR_OUT_OF_MEMORY;
}
inputFile->AppendChild(child, PR_FALSE);
+ NS_RELEASE(child);
return inputFile->QueryInterface(kIHTMLContentIID, (void**) aInstancePtrResult);
}