New submission from Christian Heimes:

Modules/_io/bufferedio.c:_bufferedreader_read_all() doesn't call 
Py_XDECREF(data) multiple times and may leak a reference in an error case. For 
example the ref leak occurs when current_size > 0 and 
PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readall, NULL) fails 
orbuffered_flush_and_rewind_unlocked(self) fails.

There are a few more places where data isn't decrefed on return, too.

CID 715364 (#2 of 2): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "data" going out of scope leaks the storage it points 
to.

----------
components: Extension Modules
messages: 192160
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: _bufferedreader_read_all() may leak reference to data
type: resource usage
versions: Python 3.3, Python 3.4

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

Reply via email to