Allocation/free mismatch in base/import/oexpress/nsOE5File.cpp

VERIFIED FIXED

Status

SeaMonkey
MailNews: Address Book & Contacts
VERIFIED FIXED
13 years ago
13 years ago

People

(Reporter: David Gardiner, Assigned: standard8)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Running PREfast static code analysis gives the following warning:

nsoe5file.cpp(223) : warning 283: Allocation/free mismatch: 'pData' is allocated
with array new [], but deleted with scalar delete (see allocation at line 185 of
d:\mozilla\mozilla\mailnews\import\oexpress\nsoe5file.cpp).
problem occurs in function 'nsOE5File::ReadMsgIndex'

Reproducible: Always

Steps to Reproduce:
(Reporter)

Updated

13 years ago
Blocks: 283681
(Assignee)

Comment 1

13 years ago
Created attachment 176497 [details] [diff] [review]
Patch to fix incorrect deletes (this bug, 283072, and 283075)

This bug fixes the allocation free mismatch reported in this bug, bug 283072,
and bug 283075.

LXR links for reviewers:

This bug:
http://lxr.mozilla.org/seamonkey/source/mailnews/import/oexpress/nsOE5File.cpp#223

bug 283072:
http://lxr.mozilla.org/seamonkey/source/mailnews/import/outlook/src/MapiApi.cpp#1100

bug 283075:
http://lxr.mozilla.org/seamonkey/source/mailnews/import/oexpress/WabObject.cpp#438

http://lxr.mozilla.org/seamonkey/source/mailnews/import/oexpress/WabObject.cpp#498


I checked the msdn documentation on GetProps and it appears it shouldn't do
anything horrible to the pTag argument, so this should work.

However I can't test it as I haven't got a windows build.
(Assignee)

Updated

13 years ago
Blocks: 283072
(Assignee)

Updated

13 years ago
Blocks: 283075
(Assignee)

Comment 2

13 years ago
If anyone can test if the attached patch works on a Windows build and report
back here, that would be very useful as we can then get the patch reviewed and
checked in.

Unfortunately, I don't have the facilities to do this.

Thanks

Comment 3

13 years ago
Comment on attachment 176497 [details] [diff] [review]
Patch to fix incorrect deletes (this bug, 283072, and 283075)

Patch works fine on Windows (i imported 
mails and address book from OE).
Attachment #176497 - Flags: review?(bienvenu)

Updated

13 years ago
Attachment #176497 - Flags: review?(bienvenu) → review+

Comment 4

13 years ago
Comment on attachment 176497 [details] [diff] [review]
Patch to fix incorrect deletes (this bug, 283072, and 283075)

Want to do sr, too?
Attachment #176497 - Flags: superreview?(bienvenu)

Comment 5

13 years ago
Comment on attachment 176497 [details] [diff] [review]
Patch to fix incorrect deletes (this bug, 283072, and 283075)

sure, thx for the fix! I'll try to check this in today.
Attachment #176497 - Flags: superreview?(bienvenu) → superreview+
(Assignee)

Comment 6

13 years ago
Reassigning bug to myself as I generated the patch. Thanks to Frank for testing
& pushing this through.

David, please can you post when you check this in, thanks.
Assignee: sspitzer → bugzilla
(Assignee)

Updated

13 years ago
Status: NEW → ASSIGNED

Comment 7

13 years ago
Patch has been checked in by timeless, resolve bug(s) as needed.
(Assignee)

Comment 8

13 years ago
Timeless checked this in:
2005-03-29 09:19	timeless%mozdev.org 	mozilla/ mailnews/ import/ outlook/ src/
MapiApi.cpp 	1.28 	1/1 
2005-03-29 09:19	timeless%mozdev.org 	mozilla/ mailnews/ import/ oexpress/
nsOE5File.cpp 	1.18 	1/1 
2005-03-29 09:19	timeless%mozdev.org 	mozilla/ mailnews/ import/ oexpress/
WabObject.cpp 	1.12 	2/2 
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
Verified FIXED via code inspection (lxr.mozilla.org).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.