Overview
| Artifact ID: | c167e95467f6a9dd24974bf330cfaf19266fd7bdbb2f903ae8099c9f94706195 |
|---|---|
| Ticket: | 9d26c038b9f978196513186f9618cffc65c50656
Potential for memory leaks using Tcl_ListObjIndex on abstract lists |
| User & Date: | apnadkarni on 2026-10-25 02:31:55 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-plain"
- comment changed to:
As documented in the migration guide, since 9.0, `Tcl_ListObjIndex` may return ephemeral `Tcl_Obj` where the returned object is not owned by the (abstract) list implementation. The caller is supposed to take ownership (call IncrRef/DecrRef directly or by adding it to the interpreter result, another list etc.) or free it with `Tcl_BounceRefCount` to ensure unreferenced objects are freed. Lists created with `lseq` are an example. Several calls to `Tcl_ListObjIndex` do not doing this, both within core as well as in the included packages like ITcl and TDBC drivers, resulting in potential for memory leaks. This is not currently a major issue as lseq is the only such abstract list in the core and is unlikely to be passed as an argument in the context of the core calls where `Tcl_ListObjIndex` is invoked. Still, it would be advisable to fix this for the future where abstract lists, whether in the core or in extensions, might become more common.
- foundin changed to: "9.0"
- is_private changed to: "0"
- login: "apnadkarni"
- priority changed to: "5 Medium"
- private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "apnadkarni"
- subsystem changed to: "- New Builtin Commands"
- title changed to: "Potential for memory leaks using Tcl_ListObjIndex"
- type changed to: "Bug"