summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 45e71ee..8185517 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -4036,14 +4036,12 @@ _listdir_windows_no_opendir(path_t *path, PyObject *list)
Py_SETREF(v, PyUnicode_EncodeFSDefault(v));
}
if (v == NULL) {
- Py_DECREF(list);
- list = NULL;
+ Py_SETREF(list, NULL);
break;
}
if (PyList_Append(list, v) != 0) {
Py_DECREF(v);
- Py_DECREF(list);
- list = NULL;
+ Py_SETREF(list, NULL);
break;
}
Py_DECREF(v);
@@ -13131,15 +13129,13 @@ os_listxattr_impl(PyObject *module, path_t *path, int follow_symlinks)
PyObject *attribute = PyUnicode_DecodeFSDefaultAndSize(start,
trace - start);
if (!attribute) {
- Py_DECREF(result);
- result = NULL;
+ Py_SETREF(result, NULL);
goto exit;
}
error = PyList_Append(result, attribute);
Py_DECREF(attribute);
if (error) {
- Py_DECREF(result);
- result = NULL;
+ Py_SETREF(result, NULL);
goto exit;
}
start = trace + 1;