1. memory leak: ob_refcnt of new ref from (unknown) _mysql_Exception is 1 too high

    Report

    1
    static PyObject *
    _mysql_get_client_info(
    PyObject *self,
    PyObject *args)
    {
    if (!PyArg_ParseTuple(args, "")) return NULL;
    check_server_init(NULL);
    return PyUnicode_FromString(mysql_get_client_info());
    }
    1. when PyArg_ParseTuple() succeeds

      taking False path

    2. when considering value == (int)0 from _mysql.c:121

      taking True path

      when considering range: -0x80000000 <= value <= -1

      taking True path

      when _mysql_Exception() succeeds

      new ref from (unknown) _mysql_Exception was allocated at: check_server_init(NULL);

      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 1 similar trace(s) to this

  2. returning (PyObject*)NULL without setting an exception

    Report

    2
    static PyObject *
    _mysql_get_client_info(
    PyObject *self,
    PyObject *args)
    {
    if (!PyArg_ParseTuple(args, "")) return NULL;
    check_server_init(NULL);
    return PyUnicode_FromString(mysql_get_client_info());
    }
    1. when PyArg_ParseTuple() succeeds

      taking False path

    2. when considering value == (int)0 from _mysql.c:121

      taking True path

      when considering range: -0x80000000 <= value <= -1

      taking True path

      when _mysql_Exception() succeeds

      found 1 similar trace(s) to this