static PyObject *_mysql_server_init( |
PyObject *self, |
PyObject *args, |
PyObject *kwargs) { |
static char *kwlist[] = {"args", "groups", NULL}; |
char **cmd_args_c=NULL, **groups_c=NULL, *s; |
int cmd_argc=0, i, groupc; |
PyObject *cmd_args=NULL, *groups=NULL, *ret=NULL, *item; |
if (_mysql_server_init_done) { |
PyErr_SetString(_mysql_ProgrammingError, |
"already initialized"); |
return NULL; |
} |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", kwlist, |
&cmd_args, &groups)) |
return NULL; |
#if MYSQL_VERSION_ID >= 40000 |
if (cmd_args) { |
if (!PySequence_Check(cmd_args)) { |
PyErr_SetString(PyExc_TypeError, |
"args must be a sequence"); |
goto finish; |
} |
cmd_argc = PySequence_Size(cmd_args); |
if (cmd_argc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"args could not be sized"); |
goto finish; |
} |
cmd_args_c = (char **) PyMem_Malloc(cmd_argc*sizeof(char *)); |
for (i=0; i< cmd_argc; i++) { |
item = PySequence_GetItem(cmd_args, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
cmd_args_c[i] = s; |
} |
} |
if (groups) { |
if (!PySequence_Check(groups)) { |
PyErr_SetString(PyExc_TypeError, |
"groups must be a sequence"); |
goto finish; |
} |
groupc = PySequence_Size(groups); |
if (groupc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"groups could not be sized"); |
goto finish; |
} |
groups_c = (char **) PyMem_Malloc((1+groupc)*sizeof(char *)); |
for (i=0; i< groupc; i++) { |
item = PySequence_GetItem(groups, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
groups_c[i] = s; |
} |
groups_c[groupc] = (char *)NULL; |
} |
/* even though this may block, don't give up the interpreter lock |
so that the server can't be initialized multiple times. */ |
if (mysql_server_init(cmd_argc, cmd_args_c, groups_c)) { |
_mysql_Exception(NULL); |
goto finish; |
} |
#endif |
ret = Py_None; |
Py_INCREF(Py_None); |
_mysql_server_init_done = 1; |
finish: |
PyMem_Free(groups_c); |
PyMem_Free(cmd_args_c); |
return ret; |
} |
was expecting final owned ob_refcnt of new ref from (unknown) _mysql_Exception to be 0 since nothing references it but final ob_refcnt is refs: 1 owned
found 24 similar trace(s) to this
when considering value == (int)0 from _mysql.c:121
taking False path
when PyArg_ParseTupleAndKeywords() succeeds
taking False path
taking True path
when considering range: -0x80000000 <= value <= -1
taking False path
when PySequence_Size() succeeds
when considering range: -0x80000000 <= value <= -2
taking False path
when PyMem_Malloc() succeeds
taking False path
taking True path
when considering range: 1 <= value <= 0x7fffffff
taking False path
when PySequence_Size() succeeds
when considering range: 0 <= value <= 0x7fffffff
taking False path
when PyMem_Malloc() succeeds
when considering range: 1 <= groupc <= 0x7fffffff
taking True path
when PySequence_GetItem() succeeds
when taking False path
calling tp_dealloc on new ref from PySequence_GetItem allocated at _mysql.c:316
when treating unknown char * from _mysql.c:317 as non-NULL
taking False path
when considering groupc == (int)1 from _mysql.c:308
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
when _mysql_Exception() succeeds
new ref from (unknown) _mysql_Exception was allocated at: _mysql_Exception(NULL);
calling PyMem_Free on PyMem_Malloc allocated at _mysql.c:314
calling PyMem_Free on PyMem_Malloc allocated at _mysql.c:292
static PyObject *_mysql_server_init( |
PyObject *self, |
PyObject *args, |
PyObject *kwargs) { |
static char *kwlist[] = {"args", "groups", NULL}; |
char **cmd_args_c=NULL, **groups_c=NULL, *s; |
int cmd_argc=0, i, groupc; |
PyObject *cmd_args=NULL, *groups=NULL, *ret=NULL, *item; |
if (_mysql_server_init_done) { |
PyErr_SetString(_mysql_ProgrammingError, |
"already initialized"); |
return NULL; |
} |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", kwlist, |
&cmd_args, &groups)) |
return NULL; |
#if MYSQL_VERSION_ID >= 40000 |
if (cmd_args) { |
if (!PySequence_Check(cmd_args)) { |
PyErr_SetString(PyExc_TypeError, |
"args must be a sequence"); |
goto finish; |
} |
cmd_argc = PySequence_Size(cmd_args); |
if (cmd_argc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"args could not be sized"); |
goto finish; |
} |
cmd_args_c = (char **) PyMem_Malloc(cmd_argc*sizeof(char *)); |
for (i=0; i< cmd_argc; i++) { |
item = PySequence_GetItem(cmd_args, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
cmd_args_c[i] = s; |
} |
} |
if (groups) { |
if (!PySequence_Check(groups)) { |
PyErr_SetString(PyExc_TypeError, |
"groups must be a sequence"); |
goto finish; |
} |
groupc = PySequence_Size(groups); |
if (groupc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"groups could not be sized"); |
goto finish; |
} |
groups_c = (char **) PyMem_Malloc((1+groupc)*sizeof(char *)); |
for (i=0; i< groupc; i++) { |
item = PySequence_GetItem(groups, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
groups_c[i] = s; |
} |
groups_c[groupc] = (char *)NULL; |
} |
/* even though this may block, don't give up the interpreter lock |
so that the server can't be initialized multiple times. */ |
if (mysql_server_init(cmd_argc, cmd_args_c, groups_c)) { |
_mysql_Exception(NULL); |
goto finish; |
} |
#endif |
ret = Py_None; |
Py_INCREF(Py_None); |
_mysql_server_init_done = 1; |
finish: |
PyMem_Free(groups_c); |
PyMem_Free(cmd_args_c); |
return ret; |
} |
found 29 similar trace(s) to this
when considering value == (int)0 from _mysql.c:121
taking False path
when PyArg_ParseTupleAndKeywords() succeeds
taking False path
taking True path
when considering range: -0x80000000 <= value <= -1
taking False path
when PySequence_Size() succeeds
when considering range: -0x80000000 <= value <= -2
taking False path
when PyMem_Malloc() succeeds
taking False path
taking True path
when considering range: 1 <= value <= 0x7fffffff
taking False path
when PySequence_Size() succeeds
when considering range: 0 <= value <= 0x7fffffff
taking False path
when PyMem_Malloc() succeeds
when considering range: 1 <= groupc <= 0x7fffffff
taking True path
when PySequence_GetItem() succeeds
when taking False path
calling tp_dealloc on new ref from PySequence_GetItem allocated at _mysql.c:316
when treating unknown char * from _mysql.c:317 as non-NULL
taking False path
when considering groupc == (int)1 from _mysql.c:308
taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
when _mysql_Exception() succeeds
calling PyMem_Free on PyMem_Malloc allocated at _mysql.c:314
calling PyMem_Free on PyMem_Malloc allocated at _mysql.c:292
static PyObject *_mysql_server_init( |
PyObject *self, |
PyObject *args, |
PyObject *kwargs) { |
static char *kwlist[] = {"args", "groups", NULL}; |
char **cmd_args_c=NULL, **groups_c=NULL, *s; |
int cmd_argc=0, i, groupc; |
PyObject *cmd_args=NULL, *groups=NULL, *ret=NULL, *item; |
if (_mysql_server_init_done) { |
PyErr_SetString(_mysql_ProgrammingError, |
"already initialized"); |
return NULL; |
} |
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO", kwlist, |
&cmd_args, &groups)) |
return NULL; |
#if MYSQL_VERSION_ID >= 40000 |
if (cmd_args) { |
if (!PySequence_Check(cmd_args)) { |
PyErr_SetString(PyExc_TypeError, |
"args must be a sequence"); |
goto finish; |
} |
cmd_argc = PySequence_Size(cmd_args); |
if (cmd_argc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"args could not be sized"); |
goto finish; |
} |
cmd_args_c = (char **) PyMem_Malloc(cmd_argc*sizeof(char *)); |
for (i=0; i< cmd_argc; i++) { |
item = PySequence_GetItem(cmd_args, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
cmd_args_c[i] = s; |
} |
} |
if (groups) { |
if (!PySequence_Check(groups)) { |
PyErr_SetString(PyExc_TypeError, |
"groups must be a sequence"); |
goto finish; |
} |
groupc = PySequence_Size(groups); |
if (groupc == -1) { |
PyErr_SetString(PyExc_TypeError, |
"groups could not be sized"); |
goto finish; |
} |
groups_c = (char **) PyMem_Malloc((1+groupc)*sizeof(char *)); |
for (i=0; i< groupc; i++) { |
item = PySequence_GetItem(groups, i); |
s = get_string(item); |
Py_DECREF(item); |
if (!s) { goto finish; } |
groups_c[i] = s; |
} |
groups_c[groupc] = (char *)NULL; |
} |
/* even though this may block, don't give up the interpreter lock |
so that the server can't be initialized multiple times. */ |
if (mysql_server_init(cmd_argc, cmd_args_c, groups_c)) { |
_mysql_Exception(NULL); |
goto finish; |
} |
#endif |
ret = Py_None; |
Py_INCREF(Py_None); |
_mysql_server_init_done = 1; |
finish: |
PyMem_Free(groups_c); |
PyMem_Free(cmd_args_c); |
return ret; |
} |
when considering value == (int)0 from _mysql.c:121
taking False path
when PyArg_ParseTupleAndKeywords() succeeds
taking False path
taking True path
when considering range: -0x80000000 <= value <= -1
taking False path
when PySequence_Size() succeeds
when considering range: -0x80000000 <= value <= -2
taking False path
when PyMem_Malloc() succeeds
taking False path
taking True path
when considering range: -0x80000000 <= value <= -1
taking False path
when PySequence_Size() succeeds
when considering range: 0 <= value <= 0x7fffffff
taking False path
when PyMem_Malloc() succeeds
when considering range: 1 <= groupc <= 0x7fffffff
taking True path
when PySequence_GetItem() fails
found 1 similar trace(s) to this