Commit 06587a0a authored by Victor Stinner's avatar Victor Stinner

Cleanup locale.localeconv(): move Py_DECREF() closer to the error

parent d305e3be
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment