IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 21 years ago

#302 closed defect (fixed)

psArrayAdd() does not properly handle reference counting

Reported by: jhoblitt Owned by: robert.desonia@…
Priority: normal Milestone:
Component: sys Version: 0.4.0
Severity: normal Keywords:
Cc:

Description

psArrayAdd() should increment the reference count on it's data parameter.
Consider the follow code example:

--
psArrayAdd(foo, 0, myData);
psFree(foo);
--

myData is now an invalid pointer without being free'd by the user.

Please also document the fact that psArrayAdd() incremements the reference count
on "data".

Change History (3)

comment:1 by robert.desonia@…, 21 years ago

Status: newassigned

comment:2 by robert.desonia@…, 21 years ago

Resolution: fixed
Status: assignedclosed

added the reference increment in CVS head.

comment:3 by Paul Price, 21 years ago

The policy on reference counter incrementing is to be made more clear in the
upcoming SDRS, and will require checking that the other collection types do this
as well.

Note: See TracTickets for help on using tickets.