Overview
| Artifact ID: | abd74bb92d1e1b9f151d16d67d16681855e78fabe11a9db4735c0f90f24b7806 |
|---|---|
| Ticket: | d052d2a1b01ba2c8f89397810d7e03c01da08ff1
avoid leak in TestsetbytearraylengthObjCmd() |
| User & Date: | chrstphrchvz on 2022-08-20 14:21:34 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-markdown"
- comment changed to:
If `TestsetbytearraylengthObjCmd()` is called with a shared value and `Tcl_SetByteArrayLength()` returns `NULL`, then the duplicated value returned by `Tcl_DuplicateObj()` should be freed, otherwise it will be leaked: <pre> --- generic/tclTest.c.orig +++ generic/tclTest.c @@ -5130,6 +5130,9 @@ obj = objv[1]; } if (NULL == Tcl_SetByteArrayLength(obj, n)) { <span style="color:green">+ if (Tcl_IsShared(objv[1])) { + Tcl_DecrRefCount(obj); + }</span> Tcl_SetResult(interp, "expected bytes", TCL_STATIC); return TCL_ERROR; } <pre> - foundin changed to: "trunk"
- is_private changed to: "0"
- login: "chrstphrchvz"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Cosmetic"
- status changed to: "Open"
- submitter changed to: "chrstphrchvz"
- subsystem changed to: "12. ByteArray Object"
- title changed to: "avoid leak in TestsetbytearraylengthObjCmd()"
- type changed to: "Patch"