Bug report
|
p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL); |
|
|
|
if (p == NULL) |
|
return NULL; |
|
|
|
len = strlen(p); |
|
if (writer != NULL) { |
|
str = _PyBytesWriter_Prepare(writer, str, len); |
|
if (str == NULL) |
|
return NULL; |
|
memcpy(str, p, len); |
|
PyMem_Free(p); |
|
str += len; |
|
return str; |
|
} |
At line 438, object p won't be freed if _PyBytesWriter_Prepare fails (returns NULL) and thus become a memory leak.
Linked PRs
Reactions are currently unavailable
Bug report
cpython/Objects/bytesobject.c
Lines 429 to 443 in 206f05a
At line 438, object p won't be freed if _PyBytesWriter_Prepare fails (returns NULL) and thus become a memory leak.
Linked PRs