From 17fe009ebd53c1e034403bf19a7880458ab51f00 Mon Sep 17 00:00:00 2001 From: Magnus Melin Date: Wed, 13 Dec 2017 22:43:28 +0200 Subject: [PATCH] Bug 1285098 - fix memory leak in nsImapServerResponseParser.cpp (coverity issue). r=aceman --- mailnews/imap/src/nsImapServerResponseParser.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mailnews/imap/src/nsImapServerResponseParser.cpp b/mailnews/imap/src/nsImapServerResponseParser.cpp index 44b592b567..c7dfe033cc 100644 --- a/mailnews/imap/src/nsImapServerResponseParser.cpp +++ b/mailnews/imap/src/nsImapServerResponseParser.cpp @@ -942,8 +942,6 @@ void nsImapServerResponseParser::mailbox(nsImapMailboxSpec *boxSpec) aURL->GetHost(boxSpec->mHostName); NS_IF_RELEASE(aURL); - if (boxname) - PL_strfree( boxname); // storage for the boxSpec is now owned by server connection fServerConnection.DiscoverMailboxSpec(boxSpec); @@ -952,6 +950,9 @@ void nsImapServerResponseParser::mailbox(nsImapMailboxSpec *boxSpec) if (NS_FAILED(fServerConnection.GetConnectionStatus())) SetConnected(false); } + + if (boxname) + PL_strfree(boxname); }