[New-bugs-announce] [issue15895] PyRun_SimpleFileExFlags() can leak a FILE pointer

Christian Heimes report at bugs.python.org
Mon Sep 10 00:50:50 CEST 2012

New submission from Christian Heimes:

In Python/pythonrun.c PyRun_SimpleFileExFlags() may leak a FILE pointer if closeit is False and maybe_pyc_file returns true. This happens when the filename ends with ".pyc" or ".pyc". In this case the file is opened a second time with fopen() a few lines lower and assigned to the same variable "fp". However "fp" is never closed.

The bug was found by Coverity as CID 719689.

Georg: I've set the priority to release blocker as a resource leak of a file pointer and therefore rare file descriptor is IMHO a severe issue.

assignee: georg.brandl
files: closeown.patch
keywords: patch
messages: 170142
nosy: brett.cannon, christian.heimes, georg.brandl
priority: release blocker
severity: normal
stage: patch review
status: open
title: PyRun_SimpleFileExFlags() can leak a FILE pointer
type: resource usage
Added file: http://bugs.python.org/file27159/closeown.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list