mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Avoid unlikely leaks in case of memory errors in Bytes_Format
This commit is contained in:
parent
2a05aa2c43
commit
f9b798aca9
|
@ -244,10 +244,14 @@ Bytes_Format(PyObject *format, PyObject *args)
|
|||
if (reslen < 0) {
|
||||
Py_DECREF(result);
|
||||
Py_XDECREF(temp);
|
||||
if (args_owned)
|
||||
Py_DECREF(args);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
if (_Bytes_Resize(&result, reslen)) {
|
||||
Py_XDECREF(temp);
|
||||
if (args_owned)
|
||||
Py_DECREF(args);
|
||||
return NULL;
|
||||
}
|
||||
res = Bytes_AS_STRING(result)
|
||||
|
|
Loading…
Reference in New Issue
Block a user