Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
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