From 6738c19e8a8fd9fa35867ece49a1ef7121fd81ea Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 13 Dec 2023 16:29:49 +0000 Subject: [PATCH] [f6f93c3b39] Missing refcount decrement to cleanup read space on io error. --- generic/tclIOCmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 9667419fbcb..808ce97ba67 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -464,6 +464,8 @@ Tcl_ReadObjCmd( returnOptsPtr = Tcl_NewDictObj(); Tcl_DictObjPut(NULL, returnOptsPtr, Tcl_NewStringObj("-data", -1), resultPtr); + } else { + Tcl_DecrRefCount(resultPtr); } /* * TIP #219.