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 { \
|
do { \
|
||||||
if (obj == NULL) \
|
if (obj == NULL) \
|
||||||
goto failed; \
|
goto failed; \
|
||||||
if (PyDict_SetItemString(result, key, obj) < 0) \
|
if (PyDict_SetItemString(result, key, obj) < 0) { \
|
||||||
|
Py_DECREF(obj); \
|
||||||
goto failed; \
|
goto failed; \
|
||||||
|
} \
|
||||||
Py_DECREF(obj); \
|
Py_DECREF(obj); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -196,7 +198,6 @@ PyLocale_localeconv(PyObject* self)
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
Py_XDECREF(result);
|
Py_XDECREF(result);
|
||||||
Py_XDECREF(x);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue