leak in create_objects_from_handles

RESOLVED FIXED in 3.12

Status

NSS
Libraries
P3
minor
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Nelson Bolyard (seldom reads bugmail), Assigned: Julien Pierre)

Tracking

({mlk})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

526 bytes, patch
Nelson Bolyard (seldom reads bugmail)
: review+
Details | Diff | Splinter Review
Function create_objects_from_handles allocates an array of pointers
whose address is kept in the variable "objects".  Then after that array 
is allocated, it tries to fill in the array with values of other allocated
objects.  If any of the allocation attempts fails, it frees all the previously
allocated objects, but does not free the array of object pointers.  It leaks
the array named "objects".
(Assignee)

Updated

9 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Updated

9 years ago
Assignee: nobody → julien.pierre.boogz
Priority: -- → P3
Target Milestone: --- → 3.12
(Assignee)

Updated

9 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

9 years ago
Created attachment 301437 [details] [diff] [review]
Fix leak
Attachment #301437 - Flags: review?(nelson)
Comment on attachment 301437 [details] [diff] [review]
Fix leak

I guess this is the right free routine for "objects".  Not sure.
Attachment #301437 - Flags: review?(nelson) → review+
(Assignee)

Comment 3

9 years ago
Nelson,

Thanks for the review. It is the right routine. You can find examples in the same source file of other objectHandles arrays allocated with nss_ZNEWARRAY and freed with nss_ZFreeIf.

I checked this in to the trunk.

Checking in devtoken.c;
/cvsroot/mozilla/security/nss/lib/dev/devtoken.c,v  <--  devtoken.c
new revision: 1.43; previous revision: 1.42
done
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.