-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Lines 429 to 443 in 206f05a
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
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error