From 424433c86b78c09a855944de7152509977d08de7 Mon Sep 17 00:00:00 2001 From: "scc%netscape.com" Date: Mon, 7 Feb 2000 10:05:14 +0000 Subject: [PATCH] bug #25621: didn't check for null before |AddRef()|. Converted |NS_ADDREF|-->|NS_IF_ADDREF|. No code review. --- xpcom/ds/nsAtomTable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index 3d83a3a9a8eb..ec69c91278be 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -158,12 +158,12 @@ NS_COM nsIAtom* NS_NewAtom(const PRUnichar* us) PLHashEntry* he = *hep; if (nsnull != he) { nsIAtom* id = (nsIAtom*) he->value; - NS_ADDREF(id); + NS_IF_ADDREF(id); return id; } AtomImpl* id = new(us, uslen) AtomImpl(); PL_HashTableRawAdd(gAtomHashTable, hep, hashCode, id->mString, id); - NS_ADDREF(id); + NS_IF_ADDREF(id); return id; }