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

Appearance settings

Commit 91bf01d

Browse filesBrowse files
authored
gh-87804: Fix the refleak in error handling of _pystatvfs_fromstructstatfs (#115335)
It was the macro expansion! Sorry!
1 parent 9182201 commit 91bf01d
Copy full SHA for 91bf01d

File tree

Expand file treeCollapse file tree

1 file changed

+9
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-8
lines changed

‎Modules/posixmodule.c

Copy file name to clipboardExpand all lines: Modules/posixmodule.c
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12916,14 +12916,15 @@ _pystatvfs_fromstructstatfs(PyObject *module, struct statfs st) {
1291612916

1291712917
_Static_assert(sizeof(st.f_blocks) == sizeof(long long), "assuming large file");
1291812918

12919-
#define SET_ITEM(v, index, item) \
12920-
do { \
12921-
if (item == NULL) { \
12922-
Py_DECREF(v); \
12923-
return NULL; \
12924-
} \
12925-
PyStructSequence_SET_ITEM(v, index, item); \
12926-
} while (0) \
12919+
#define SET_ITEM(SEQ, INDEX, EXPR) \
12920+
do { \
12921+
PyObject *obj = (EXPR); \
12922+
if (obj == NULL) { \
12923+
Py_DECREF((SEQ)); \
12924+
return NULL; \
12925+
} \
12926+
PyStructSequence_SET_ITEM((SEQ), (INDEX), obj); \
12927+
} while (0)
1292712928

1292812929
SET_ITEM(v, 0, PyLong_FromLong((long) st.f_iosize));
1292912930
SET_ITEM(v, 1, PyLong_FromLong((long) st.f_bsize));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.