New submission from Stefan Behnel:

While writing the patch for issue 17327, I noticed that there is a double 
reference leak in dict_setdefault() under the rare condition that resizing 
fails. I'm not 100% sure that it's ok to move the increfs behind the resizing, 
but considering that the resizing code actually looks safe and shouldn't kill 
references that are currently in the dict, I don't think it can be a problem. 
And the caller should always own a reference to these two anyway. 
Alternatively, decrefing them if the failure occurs would be a less intrusive 
change.

----------
components: Interpreter Core
files: dict_setdefault_refleak.patch
keywords: patch
messages: 183261
nosy: scoder
priority: normal
severity: normal
status: open
title: Fix reference leak in dict_setdefault() in case of resize failure
type: resource usage
versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29285/dict_setdefault_refleak.patch

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

Reply via email to