Closed Bug 279278 Opened 20 years ago Closed 19 years ago

Potential memory leak in nsImapServerResponseParser

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martin.gerbershagen, Assigned: engel)

References

Details

(Keywords: memory-leak)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8a6) Gecko/20050118
Build Identifier: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8a6) Gecko/20050118

In file nsImapServerResponseParser.cpp, line 369 the memory allocated by
PL_strdup(currentCommand) is not always deleted. If the right side of the && 
in the condition 
if (copyCurrentCommand && !fServerConnection.DeathSignalReceived())
is false, the block is not executed and then the PR_Free(copyCurrentCommand); in
line 387 is never called.

Reproducible: Always

Steps to Reproduce:
Somewhat related, another variable with the same name |copyCurrentCommand| could
be freed even if it was null.

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp&rev=1.118&root=/cvsroot#208
Summary: Potential memory leak → Potential memory leak in nsImapServerResponseParser
fixes the two issues mentioned above
Assignee: sspitzer → Hans-A.Engel
Status: NEW → ASSIGNED
Attachment #172035 - Flags: review?(bienvenu)
Component: MailNews: Account Manager → Networking: IMAP
OS: Solaris → All
Product: Mozilla Application Suite → Core
Hardware: Sun → All
Version: unspecified → Trunk
Attachment #172035 - Attachment is obsolete: true
Attachment #172035 - Flags: review?(bienvenu)
Comment on attachment 195336 [details] [diff] [review]
properly freeing copyCurrentCommand, better patch (checked in)

looks good, thx.
Attachment #195336 - Flags: review?(bienvenu) → review+
Attachment #195336 - Flags: superreview?(mscott)
Attachment #195336 - Flags: superreview?(mscott) → superreview?(bienvenu)
Attachment #195336 - Flags: superreview?(bienvenu) → superreview+
Comment on attachment 195336 [details] [diff] [review]
properly freeing copyCurrentCommand, better patch (checked in)

Patch Checked in:
/cvsroot/mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp,v  <-- 
nsImapServerResponseParser.cpp
new revision: 1.126; previous revision: 1.125
done
Attachment #195336 - Attachment description: properly freeing copyCurrentCommand, better patch → properly freeing copyCurrentCommand, better patch (checked in)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Blocks: 313038
Keywords: mlk
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: