Closed Bug 626954 Opened 14 years ago Closed 13 years ago

memory leak in MimeStartParamExists()

Categories

(MailNews Core :: MIME, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.3a3

People

(Reporter: eagle.lu, Assigned: eagle.lu)

References

Details

(Keywords: memory-leak)

Attachments

(1 file, 1 obsolete file)

Using libumem.so+mdb tools on OpenSolaris. I found a memory leak in MimeStartParamExists()
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → brian.lu
Attachment #505003 - Flags: review?(neil)
Keywords: mlk
Comment on attachment 505003 [details] [diff] [review]
patch

>   char *ct = MimeHeaders_get (obj->headers, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE);
>   char *st = (ct
>               ? MimeHeaders_get_parameter(ct, HEADER_PARM_START, NULL, NULL)
>               : 0);
>   if (!st)
>+  {
>+    PR_FREEIF(ct);
>     return PR_FALSE;
>+  }
> 
>   PR_FREEIF(st);
>   PR_FREEIF(ct);
Wouldn't it be easier to move the PR_FREEIF(ct); to just before the if (!st)?

> MimeThisIsStartPart(MimeObject *obj, MimeObject* child)
Technically I think this function also leaks ct, but it probably doesn't get called if the previous one returns false, which is why you don't notice.
Attached patch new patchSplinter Review
Attachment #505003 - Attachment is obsolete: true
Attachment #505320 - Flags: review?(neil)
Attachment #505003 - Flags: review?(neil)
Attachment #505320 - Flags: review?(neil) → review+
Keywords: checkin-needed
Checked in: http://hg.mozilla.org/comm-central/rev/7887a1473146
Status: NEW → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.3a3
Version: unspecified → Trunk
Blocks: 110171
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: