Bug 839447 - Part 4: Fix a potential null dereference; r=I'm an idiot FIREFOX_AURORA_21_BASE
authorMs2ger <ms2ger@gmail.com>
Tue, 19 Feb 2013 13:20:40 +0100
changeset 122677 cc37417e2c284aed960f98ffa479de4ccdd5c7c3
parent 122676 88d66cdbdc81e898d72c580e7d3c411f78dc4eaa
child 122678 cde67a09beaddce99883c78b0a95bea91ad2e63c
child 122704 60a3f369ccf05850f0a08fa95cc4223e6d2cf97d
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersI
bugs839447
milestone21.0a1
Bug 839447 - Part 4: Fix a potential null dereference; r=I'm an idiot
content/html/content/src/HTMLOptionElement.cpp
--- a/content/html/content/src/HTMLOptionElement.cpp
+++ b/content/html/content/src/HTMLOptionElement.cpp
@@ -95,17 +95,17 @@ NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLA
 
 
 NS_IMPL_ELEMENT_CLONE(HTMLOptionElement)
 
 
 NS_IMETHODIMP
 HTMLOptionElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
-  NS_ADDREF(*aForm = GetForm());
+  NS_IF_ADDREF(*aForm = GetForm());
   return NS_OK;
 }
 
 nsHTMLFormElement*
 HTMLOptionElement::GetForm()
 {
   nsHTMLSelectElement* selectControl = GetSelect();
   return selectControl ? selectControl->GetForm() : nullptr;