<!-- If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not the right place to seek help. Consider the following options instead: - reading the Python tutorial: https://docs.python.org/3/tutorial/ - posting in the "Users" category on discuss.python.org: https://discuss.python.org/c/users/7 - emailing the Python-list mailing list: https://mail.python.org/mailman/listinfo/python-list - searching our issue tracker (https://github.com/python/cpython/issues) to see if your problem has already been reported --> # Bug report https://github.com/python/cpython/blob/206f05a46b426eb374f724f8e7cd42f2f9643bb8/Objects/bytesobject.c#L429-L443 At line 438, object `p` won't be freed if `_PyBytesWriter_Prepare` fails (returns NULL) and thus become a memory leak. <!-- gh-linked-prs --> ### Linked PRs * gh-101057 * gh-101076 * gh-101077 <!-- /gh-linked-prs -->
Bug report
cpython/Objects/bytesobject.c
Lines 429 to 443 in 206f05a
At line 438, object
pwon't be freed if_PyBytesWriter_Preparefails (returns NULL) and thus become a memory leak.Linked PRs
formatfloat()inbytesobject.c#101057formatfloat()inbytesobject.c(GH-101057) #101076formatfloat()inbytesobject.c(GH-101057) #101077