mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-07-28 06:40:03 +00:00
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user