mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Cleanup locale.localeconv(): move Py_DECREF() closer to the error
This commit is contained in:
parent
1ce3f840be
commit
f38a5c28e0
@ -151,8 +151,10 @@ PyLocale_localeconv(PyObject* self)
|
||||
do { \
|
||||
if (obj == NULL) \
|
||||
goto failed; \
|
||||
if (PyDict_SetItemString(result, key, obj) < 0) \
|
||||
if (PyDict_SetItemString(result, key, obj) < 0) { \
|
||||
Py_DECREF(obj); \
|
||||
goto failed; \
|
||||
} \
|
||||
Py_DECREF(obj); \
|
||||
} while (0)
|
||||
|
||||
@ -196,7 +198,6 @@ PyLocale_localeconv(PyObject* self)
|
||||
|
||||
failed:
|
||||
Py_XDECREF(result);
|
||||
Py_XDECREF(x);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user