Skip to content

Commit 07e1245

Browse files
committed
Correct style and check error when appending to the temp list
1 parent 9a2ebfb commit 07e1245

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Modules/posixmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5181,7 +5181,7 @@ enum posix_spawn_file_actions_identifier {
51815181
static int
51825182
parse_file_actions(PyObject *file_actions,
51835183
posix_spawn_file_actions_t *file_actionsp,
5184-
PyObject* temp_buffer)
5184+
PyObject *temp_buffer)
51855185
#else
51865186
static int
51875187
parse_file_actions(PyObject *file_actions,
@@ -5232,7 +5232,10 @@ parse_file_actions(PyObject *file_actions,
52325232
goto fail;
52335233
}
52345234
#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ < 20))
5235-
PyList_Append(temp_buffer, path);
5235+
int error = PyList_Append(temp_buffer, path);
5236+
if (error) {
5237+
goto fail;
5238+
}
52365239
#endif
52375240
errno = posix_spawn_file_actions_addopen(file_actionsp,
52385241
fd, PyBytes_AS_STRING(path), oflag, (mode_t)mode);

0 commit comments

Comments
 (0)