Initialize mFilePath to nsnull. I was crashing in the dtor of the url because it was pointing to unitialized memory

whenever I tried to get msgs from a newsgroup on win32.
This commit is contained in:
mscott%netscape.com 1999-06-12 01:06:22 +00:00
Родитель 798b2f73b0
Коммит 4eafde157f
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -73,6 +73,8 @@ nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup)
m_port = NEWS_PORT;
m_spec = nsnull;
m_search = nsnull;
m_filePath = nsnull;
m_container = aContainer;
NS_IF_ADDREF(m_container);
@ -96,11 +98,7 @@ nsNntpUrl::~nsNntpUrl()
PR_FREEIF(m_errorMessage);
PR_FREEIF(m_newsgroupName);
if (m_filePath) {
delete m_filePath;
m_filePath = nsnull;
}
delete m_filePath;
PR_FREEIF(m_spec);
PR_FREEIF(m_protocol);
PR_FREEIF(m_host);