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

Commit43cd7aa

Browse files
authored
gh-120754: Fix memory leak in FileIO.__init__() (#124225)
Free 'self->stat_atopen' before assigning it, sinceio.FileIO.__init__() can be called multiple times manually(especially by test_io).
1 parentea7fe1f commit43cd7aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎Modules/_io/fileio.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
457457
#endif
458458
}
459459

460+
PyMem_Free(self->stat_atopen);
460461
self->stat_atopen=PyMem_New(struct_Py_stat_struct,1);
461462
if (self->stat_atopen==NULL) {
462463
PyErr_NoMemory();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp