New submission from Charalampos Stratakis <cstra...@redhat.com>:

In tokenizer.c we have those lines of code [0]:

if (final_length < needed_length && final_length)
    /* should never fail */
    buf = PyMem_REALLOC(buf, final_length);
return buf;

If however that realloc fails, the memory allocated initially for buf, will not 
be freed.

[0] https://github.com/python/cpython/blob/master/Parser/tokenizer.c#L652

----------
messages: 338375
nosy: cstratak
priority: normal
severity: normal
status: open
title: tokenizer.c memory leak in case of realloc failure

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36367>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to