1. memory leak: ob_refcnt of '*_mysql_ConnectionObject_Type.85' is 1 too high

    Report

    1
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() succeeds

      taking False path

    9. when PyImport_ImportModule() succeeds

      taking False path

    10. taking False path

    11. when _mysql_NewException() succeeds

    12. taking False path

    13. when _mysql_NewException() succeeds

    14. taking False path

    15. when _mysql_NewException() succeeds

    16. taking False path

    17. when _mysql_NewException() succeeds

    18. taking False path

    19. when _mysql_NewException() succeeds

    20. taking False path

    21. when _mysql_NewException() succeeds

    22. taking False path

    23. when _mysql_NewException() succeeds

    24. taking False path

    25. when _mysql_NewException() succeeds

    26. taking False path

    27. when _mysql_NewException() succeeds

    28. taking False path

    29. when _mysql_NewException() succeeds

    30. taking False path

    31. when _mysql_NewException() succeeds

    32. taking False path

    33. when PyString_FromString() succeeds

      taking False path

    34. when PyDict_SetItemString() succeeds

    35. taking True path

      when taking True path

    36. PyErr_Occurred()

      taking False path

    37. returning

      was expecting final owned ob_refcnt of '*_mysql_ConnectionObject_Type.85' to be 0 since nothing references it but final ob_refcnt is refs: 1 owned, 2 borrowed

      found 54 similar trace(s) to this

  2. memory leak: ob_refcnt of '*_mysql_ResultObject_Type.86' is 1 too high

    Report

    2
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() succeeds

      taking False path

    9. when PyImport_ImportModule() succeeds

      taking False path

    10. taking False path

    11. when _mysql_NewException() succeeds

    12. taking False path

    13. when _mysql_NewException() succeeds

    14. taking False path

    15. when _mysql_NewException() succeeds

    16. taking False path

    17. when _mysql_NewException() succeeds

    18. taking False path

    19. when _mysql_NewException() succeeds

    20. taking False path

    21. when _mysql_NewException() succeeds

    22. taking False path

    23. when _mysql_NewException() succeeds

    24. taking False path

    25. when _mysql_NewException() succeeds

    26. taking False path

    27. when _mysql_NewException() succeeds

    28. taking False path

    29. when _mysql_NewException() succeeds

    30. taking False path

    31. when _mysql_NewException() succeeds

    32. taking False path

    33. when PyString_FromString() succeeds

      taking False path

    34. when PyDict_SetItemString() succeeds

    35. taking True path

      when taking True path

    36. PyErr_Occurred()

      taking False path

    37. returning

      was expecting final owned ob_refcnt of '*_mysql_ResultObject_Type.86' to be 0 since nothing references it but final ob_refcnt is refs: 1 owned, 2 borrowed

      found 54 similar trace(s) to this

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

    Report

    3
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() succeeds

      taking False path

    9. when PyImport_ImportModule() succeeds

      taking False path

    10. taking False path

    11. when _mysql_NewException() succeeds

    12. taking False path

    13. when _mysql_NewException() succeeds

    14. taking False path

    15. when _mysql_NewException() succeeds

    16. taking False path

    17. when _mysql_NewException() succeeds

    18. taking False path

    19. when _mysql_NewException() succeeds

    20. taking False path

    21. when _mysql_NewException() succeeds

    22. taking False path

    23. when _mysql_NewException() succeeds

    24. taking False path

    25. when _mysql_NewException() succeeds

    26. taking False path

    27. when _mysql_NewException() succeeds

    28. taking False path

    29. when _mysql_NewException() succeeds

    30. taking False path

    31. when _mysql_NewException() succeeds

    32. taking False path

    33. when PyString_FromString() succeeds

      taking False path

    34. when PyDict_SetItemString() succeeds

    35. taking True path

      when taking True path

    36. PyErr_Occurred()

      taking False path

    37. returning

      was expecting final owned ob_refcnt of new ref from (unknown) PyRun_StringFlags to be 0 since nothing references it but final ob_refcnt is refs: 1 owned, 1 borrowed

      found 54 similar trace(s) to this

    38. new ref from (unknown) PyRun_StringFlags was allocated at: if (PyDict_SetItemString(dict, "version_info",

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

    Report

    4
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() succeeds

      taking False path

    9. when PyImport_ImportModule() succeeds

      taking False path

    10. taking False path

    11. when _mysql_NewException() succeeds

    12. taking False path

    13. when _mysql_NewException() succeeds

    14. taking False path

    15. when _mysql_NewException() succeeds

    16. taking False path

    17. when _mysql_NewException() succeeds

    18. taking False path

    19. when _mysql_NewException() succeeds

    20. taking False path

    21. when _mysql_NewException() succeeds

    22. taking False path

    23. when _mysql_NewException() succeeds

    24. taking False path

    25. when _mysql_NewException() succeeds

    26. taking False path

    27. when _mysql_NewException() succeeds

    28. taking False path

    29. when _mysql_NewException() succeeds

    30. taking False path

    31. when _mysql_NewException() succeeds

    32. taking False path

    33. when PyString_FromString() succeeds

      taking False path

    34. when PyDict_SetItemString() succeeds

    35. taking True path

      when taking True path

    36. PyErr_Occurred()

      taking False path

    37. returning

      was expecting final owned ob_refcnt of new ref from (unknown) PyUnicodeUCS4_FromString to be 0 since nothing references it but final ob_refcnt is refs: 1 owned, 1 borrowed

      found 54 similar trace(s) to this

    38. new ref from (unknown) PyUnicodeUCS4_FromString was allocated at: if (PyDict_SetItemString(dict, "__version__",

  5. future use-after-free: ob_refcnt of '*module' is 1 too low

    Report

    5
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

      '*module' was allocated at: module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() succeeds

      taking False path

    9. when PyImport_ImportModule() succeeds

      taking False path

    10. taking False path

    11. when _mysql_NewException() succeeds

    12. taking False path

    13. when _mysql_NewException() succeeds

    14. taking False path

    15. when _mysql_NewException() succeeds

    16. taking False path

    17. when _mysql_NewException() succeeds

    18. taking False path

    19. when _mysql_NewException() succeeds

    20. taking False path

    21. when _mysql_NewException() succeeds

    22. taking False path

    23. when _mysql_NewException() succeeds

    24. taking False path

    25. when _mysql_NewException() succeeds

    26. taking False path

    27. when _mysql_NewException() succeeds

    28. taking False path

    29. when _mysql_NewException() succeeds

    30. taking False path

    31. when _mysql_NewException() succeeds

    32. taking False path

    33. when PyString_FromString() succeeds

      taking False path

    34. when PyDict_SetItemString() fails

    35. taking True path

      when taking True path

    36. PyErr_Occurred()

      taking True path

    37. calling PyErr_SetString()

    38. taking True path

      when taking True path

    39. returning

      was expecting final owned ob_refcnt of '*module' to be 0 since nothing references it but final ob_refcnt is refs: -1 owned, 1 borrowed

      found 25 similar trace(s) to this

  6. comparison against uninitialized data (emod) at _mysql.c:3074

    Report

    6
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    7. when PyDict_SetItemString() succeeds

      taking False path

    8. when PyDict_SetItemString() fails

      taking True path

    9. found 3 similar trace(s) to this

  7. calling PyDict_SetItemString with NULL as argument 3 (D.15967) at _mysql.c:3021

    Report

    7
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() succeeds

      when PyDict_SetItemString() succeeds

      taking False path

    6. when PyUnicodeUCS4_FromString() fails

  8. calling PyDict_SetItemString with NULL as argument 3 (D.15964) at _mysql.c:3017

    Report

    8
    DL_EXPORT(void)
    init_mysql(void)
    #endif
    {
    PyObject *dict, *module, *emod, *edict;
    utf8conn = mysql_init(NULL);
    utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
    #ifdef IS_PY3K
    module = PyModule_Create(&_mysqlmodule);
    if (!module) return module; /* this really should never happen */
    #else
    module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
    (PyObject *)NULL, PYTHON_API_VERSION);
    if (!module) return; /* this really should never happen */
    #endif
    #ifdef IS_PY3K
    Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
    Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
    #else
    _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
    _mysql_ResultObject_Type.ob_type = &PyType_Type;
    #endif
    #if PY_VERSION_HEX >= 0x02020000
    _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
    _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
    _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
    #ifndef IS_PY3K
    _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
    _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
    #endif
    #endif
    if (!(dict = PyModule_GetDict(module))) goto error;
    if (PyDict_SetItemString(dict, "version_info",
    PyRun_String(QUOTE(version_info), Py_eval_input,
    dict, dict)))
    goto error;
    if (PyDict_SetItemString(dict, "__version__",
    PyUnicode_FromString(QUOTE(__version__))))
    goto error;
    if (PyDict_SetItemString(dict, "connection",
    (PyObject *)&_mysql_ConnectionObject_Type))
    goto error;
    Py_INCREF(&_mysql_ConnectionObject_Type);
    if (PyDict_SetItemString(dict, "result",
    (PyObject *)&_mysql_ResultObject_Type))
    goto error;
    Py_INCREF(&_mysql_ResultObject_Type);
    if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
    PyErr_Print();
    goto error;
    }
    if (!(edict = PyModule_GetDict(emod))) goto error;
    if (!(_mysql_MySQLError =
    _mysql_NewException(dict, edict, "MySQLError")))
    goto error;
    if (!(_mysql_Warning =
    _mysql_NewException(dict, edict, "Warning")))
    goto error;
    if (!(_mysql_Error =
    _mysql_NewException(dict, edict, "Error")))
    goto error;
    if (!(_mysql_InterfaceError =
    _mysql_NewException(dict, edict, "InterfaceError")))
    goto error;
    if (!(_mysql_DatabaseError =
    _mysql_NewException(dict, edict, "DatabaseError")))
    goto error;
    if (!(_mysql_DataError =
    _mysql_NewException(dict, edict, "DataError")))
    goto error;
    if (!(_mysql_OperationalError =
    _mysql_NewException(dict, edict, "OperationalError")))
    goto error;
    if (!(_mysql_IntegrityError =
    _mysql_NewException(dict, edict, "IntegrityError")))
    goto error;
    if (!(_mysql_InternalError =
    _mysql_NewException(dict, edict, "InternalError")))
    goto error;
    if (!(_mysql_ProgrammingError =
    _mysql_NewException(dict, edict, "ProgrammingError")))
    goto error;
    if (!(_mysql_NotSupportedError =
    _mysql_NewException(dict, edict, "NotSupportedError")))
    goto error;
    if (!(_mysql_NULL = PyBytes_FromString("NULL")))
    goto error;
    if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
    error:
    if (emod) Py_DECREF(emod);
    if (PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError,
    "_mysql: init failed");
    if (module) Py_DECREF(module);
    module = NULL;
    }
    #ifdef IS_PY3K
    return module;
    #endif
    }
    1. when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL

    2. when Py_InitModule4_64() succeeds

    3. taking False path

    4. taking False path

    5. when PyRun_StringFlags() fails