Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A possible resource leak in Python 3.11.0 #98872

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@SQLPATCH

Description

@SQLPATCH

Bug report

Hi, I'm currently using Infer, a static analysis tool, to analyze the native code of CPython.
I found a possible resource leak vulnerability:
Resource of type_IO_FILE acquired by call tofopen() at line 184 is not released after line 196.

Programs/_freeze_module.c:196:

  195.     if (ferror(outfile)) {  196.         fprintf(stderr, "error when writing to '%s'\n", outpath);                       ^  197.         return -1;  198.     }

I think that resource should be released before exiting, a PR maybe like:

    if (ferror(outfile)) {        fprintf(stderr, "error when writing to '%s'\n", outpath);        fclose(outfile);        return -1;     }

Python is my favorite programming language. I hope this discovery can be helpful to you!

My environment

  • CPython versions tested on: 3.11.0
  • Operating system and architecture: Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp