From: Pablo Galindo Salgado Date: Sat, 25 Jan 2025 16:54:20 +0000 (+0000) Subject: gh-129271: Fix reference leak with unicode writer in fast path in the json module... X-Git-Tag: v3.14.0a5~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a54a653b718a70c96755f6fc39f01f5c582558a;p=thirdparty%2FPython%2Fcpython.git gh-129271: Fix reference leak with unicode writer in fast path in the json module (#129272) --- diff --git a/Modules/_json.c b/Modules/_json.c index 091bcbfdced4..31a5e935e13a 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -417,6 +417,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next if (ret == NULL) { goto bail; } + PyUnicodeWriter_Discard(writer); *next_end_ptr = next + 1;; return ret; }