Closed Bug 489168 Opened 12 years ago Closed 12 years ago

Leaking nsAbCardProperty when collecting addresses for email addresses that already exist in the address book

Categories

(MailNews Core :: Address Book, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: standard8, Assigned: standard8)

Details

(Keywords: memory-leak)

Attachments

(1 file)

Attached patch The fixSplinter Review
I was just testing some xpcshell patches, in particular taking a brief look at the ones that will tidy up the leak/bloat of xpcshell tests and discovered a leak in the address collector.

When we collect an email address and that email address already exists in the database, we're getting a result from nsAbAddressCollector::GetCardFromProperty. The issue is that function returns a simple nsIAbCard* which is the result from GetCardForEmailAddress - which has already been addrefed, but not taken into account here. Therefore we should wrap the result type in already_AddRefed which will then mean we don't leak the nsAbCardProperty.
Attachment #373654 - Flags: superreview?(neil)
Attachment #373654 - Flags: review?(neil)
Comment on attachment 373654 [details] [diff] [review]
The fix

Bah, I didn't spot that :-(
Attachment #373654 - Flags: superreview?(neil)
Attachment #373654 - Flags: superreview+
Attachment #373654 - Flags: review?(neil)
Attachment #373654 - Flags: review+
Checked in: http://hg.mozilla.org/comm-central/rev/b8c8bf5edbf2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.