[New-bugs-announce] [issue17328] Fix reference leak in dict_setdefault() in case of resize failure

Stefan Behnel report at bugs.python.org
Fri Mar 1 15:03:53 CET 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue17328>
_______________________________________


More information about the New-bugs-announce mailing list