Overview
| Artifact ID: | 57ddd2c8ad02e79ca6618065a76bdd064e10ec8b |
|---|---|
| Ticket: | 2820349fffffffffffffffffffffffffffffffff
Tcl_ThreadQueueEvent can lead to memory leaks |
| User & Date: | flatworm on 2009-07-12 12:15:44 |
Changes
- assignee changed to: "kennykb"
- cmimetype changed to: "text/plain"
- comment changed to:
Tcl_ThreadQueueEvent() only calls QueueEvent() which actually adds the event to the specified notifier's queue if such notifier was found, that is, if there is a notifier bound to the thread specified in the call. As the specification states that after a call to Tcl_ThreadQueueEvent() the event's memory will be owned by the approptiate notifier, and the function does not return any information to the caller about whether the event was delivered or not, then if the target thread does not exist, the event memory will be lost. Since this function is a part of the public API (and therefore can be called with arbitrary arguments) the possibility of the non-existing target thread is possible. I think that turning if (tsdPtr) { QueueEvent(tsdPtr, evPtr, position); } into if (tsdPtr) { QueueEvent(tsdPtr, evPtr, position); } else { ckfree((char*) evPtr); } would fulfill the contract about the event's memory handling. - foundin changed to: "obsolete: 8.6b1.1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "flatworm"
- subsystem changed to: "01. Notifier"
- title changed to: "Tcl_ThreadQueueEvent can lead to memory leaks"
- type changed to: "Bug"