Skip to content

Commit 7a54a65

Browse files
authored
gh-129271: Fix reference leak with unicode writer in fast path in the json module (#129272)
1 parent e119526 commit 7a54a65

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
417417
if (ret == NULL) {
418418
goto bail;
419419
}
420+
PyUnicodeWriter_Discard(writer);
420421
*next_end_ptr = next + 1;;
421422
return ret;
422423
}

0 commit comments

Comments
 (0)