gh-99537: Use Py_SETREF(var, NULL) in C code (#99687)

Replace "Py_DECREF(var); var = NULL;" with "Py_SETREF(var, NULL);".
This commit is contained in:
Victor Stinner 2022-11-23 14:57:50 +01:00 committed by GitHub
parent 5d9183c7ad
commit 81f7359f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 44 additions and 87 deletions

View file

@ -84,7 +84,7 @@ get_proxy_settings(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
if (v == NULL) goto error;
r = PyDict_SetItemString(result, "exclude_simple", v);
Py_DECREF(v); v = NULL;
Py_SETREF(v, NULL);
if (r == -1) goto error;
anArray = CFDictionaryGetValue(proxyDict,