Fix for CONPY-273:

Fixed crash in escape_string method of connection object:
Instead of PyMem_RawCalloc we allocate memory via PyMem_Calloc, since
the memory will be freed by PyMem_Free (instead of PyMem_RawFree).
This commit is contained in:
Georg Richter
2023-11-22 13:08:50 +01:00
parent f26934540d
commit f9adb73366

View File

@ -874,7 +874,7 @@ static PyObject *MrdbConnection_escape_string(MrdbConnection *self,
return NULL;
from= (char *)PyUnicode_AsUTF8AndSize(string, (Py_ssize_t *)&from_length);
if (!(to= (char *)PyMem_RawCalloc(1, from_length * 2 + 1)))
if (!(to= (char *)PyMem_Calloc(1, from_length * 2 + 1)))
{
return NULL;
}