File: | _mysql.c |
Function: | init_mysql |
Error: | memory leak: ob_refcnt of '*_mysql_ConnectionObject_Type.85' is 1 too high |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
returning
memory leak: ob_refcnt of '*_mysql_ConnectionObject_Type.85' is 1 too high
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
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
ob_refcnt is now refs: 0 owned, 2 borrowed
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
ob_refcnt is now refs: 1 owned, 2 borrowed
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() succeeds
taking False path
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
when PyImport_ImportModule() succeeds
taking False path
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
taking False path
3037 if (!(_mysql_MySQLError =
taking False path
3038 _mysql_NewException(dict, edict, "MySQLError")))
when _mysql_NewException() succeeds
3039 goto error;
3040 if (!(_mysql_Warning =
taking False path
3041 _mysql_NewException(dict, edict, "Warning")))
when _mysql_NewException() succeeds
3042 goto error;
3043 if (!(_mysql_Error =
taking False path
3044 _mysql_NewException(dict, edict, "Error")))
when _mysql_NewException() succeeds
3045 goto error;
3046 if (!(_mysql_InterfaceError =
taking False path
3047 _mysql_NewException(dict, edict, "InterfaceError")))
when _mysql_NewException() succeeds
3048 goto error;
3049 if (!(_mysql_DatabaseError =
taking False path
3050 _mysql_NewException(dict, edict, "DatabaseError")))
when _mysql_NewException() succeeds
3051 goto error;
3052 if (!(_mysql_DataError =
taking False path
3053 _mysql_NewException(dict, edict, "DataError")))
when _mysql_NewException() succeeds
3054 goto error;
3055 if (!(_mysql_OperationalError =
taking False path
3056 _mysql_NewException(dict, edict, "OperationalError")))
when _mysql_NewException() succeeds
3057 goto error;
3058 if (!(_mysql_IntegrityError =
taking False path
3059 _mysql_NewException(dict, edict, "IntegrityError")))
when _mysql_NewException() succeeds
3060 goto error;
3061 if (!(_mysql_InternalError =
taking False path
3062 _mysql_NewException(dict, edict, "InternalError")))
when _mysql_NewException() succeeds
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
taking False path
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
when _mysql_NewException() succeeds
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
taking False path
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
when _mysql_NewException() succeeds
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
when PyString_FromString() succeeds
taking False path
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
when PyDict_SetItemString() succeeds
3073 error:
3074 if (emod) Py_DECREF(emod);
taking True path
when taking True path
3075 if (PyErr_Occurred()) {
PyErr_Occurred()
taking False path
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | memory leak: ob_refcnt of '*_mysql_ResultObject_Type.86' is 1 too high |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
returning
memory leak: ob_refcnt of '*_mysql_ResultObject_Type.86' is 1 too high
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
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() succeeds
taking False path
ob_refcnt is now refs: 0 owned, 2 borrowed
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
ob_refcnt is now refs: 1 owned, 2 borrowed
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
when PyImport_ImportModule() succeeds
taking False path
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
taking False path
3037 if (!(_mysql_MySQLError =
taking False path
3038 _mysql_NewException(dict, edict, "MySQLError")))
when _mysql_NewException() succeeds
3039 goto error;
3040 if (!(_mysql_Warning =
taking False path
3041 _mysql_NewException(dict, edict, "Warning")))
when _mysql_NewException() succeeds
3042 goto error;
3043 if (!(_mysql_Error =
taking False path
3044 _mysql_NewException(dict, edict, "Error")))
when _mysql_NewException() succeeds
3045 goto error;
3046 if (!(_mysql_InterfaceError =
taking False path
3047 _mysql_NewException(dict, edict, "InterfaceError")))
when _mysql_NewException() succeeds
3048 goto error;
3049 if (!(_mysql_DatabaseError =
taking False path
3050 _mysql_NewException(dict, edict, "DatabaseError")))
when _mysql_NewException() succeeds
3051 goto error;
3052 if (!(_mysql_DataError =
taking False path
3053 _mysql_NewException(dict, edict, "DataError")))
when _mysql_NewException() succeeds
3054 goto error;
3055 if (!(_mysql_OperationalError =
taking False path
3056 _mysql_NewException(dict, edict, "OperationalError")))
when _mysql_NewException() succeeds
3057 goto error;
3058 if (!(_mysql_IntegrityError =
taking False path
3059 _mysql_NewException(dict, edict, "IntegrityError")))
when _mysql_NewException() succeeds
3060 goto error;
3061 if (!(_mysql_InternalError =
taking False path
3062 _mysql_NewException(dict, edict, "InternalError")))
when _mysql_NewException() succeeds
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
taking False path
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
when _mysql_NewException() succeeds
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
taking False path
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
when _mysql_NewException() succeeds
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
when PyString_FromString() succeeds
taking False path
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
when PyDict_SetItemString() succeeds
3073 error:
3074 if (emod) Py_DECREF(emod);
taking True path
when taking True path
3075 if (PyErr_Occurred()) {
PyErr_Occurred()
taking False path
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | memory leak: ob_refcnt of new ref from (unknown) PyRun_StringFlags is 1 too high |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
returning
memory leak: ob_refcnt of new ref from (unknown) PyRun_StringFlags is 1 too high
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
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
new ref from (unknown) PyRun_StringFlags was allocated at: if (PyDict_SetItemString(dict, "version_info",
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() succeeds
taking False path
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
when PyImport_ImportModule() succeeds
taking False path
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
taking False path
3037 if (!(_mysql_MySQLError =
taking False path
3038 _mysql_NewException(dict, edict, "MySQLError")))
when _mysql_NewException() succeeds
3039 goto error;
3040 if (!(_mysql_Warning =
taking False path
3041 _mysql_NewException(dict, edict, "Warning")))
when _mysql_NewException() succeeds
3042 goto error;
3043 if (!(_mysql_Error =
taking False path
3044 _mysql_NewException(dict, edict, "Error")))
when _mysql_NewException() succeeds
3045 goto error;
3046 if (!(_mysql_InterfaceError =
taking False path
3047 _mysql_NewException(dict, edict, "InterfaceError")))
when _mysql_NewException() succeeds
3048 goto error;
3049 if (!(_mysql_DatabaseError =
taking False path
3050 _mysql_NewException(dict, edict, "DatabaseError")))
when _mysql_NewException() succeeds
3051 goto error;
3052 if (!(_mysql_DataError =
taking False path
3053 _mysql_NewException(dict, edict, "DataError")))
when _mysql_NewException() succeeds
3054 goto error;
3055 if (!(_mysql_OperationalError =
taking False path
3056 _mysql_NewException(dict, edict, "OperationalError")))
when _mysql_NewException() succeeds
3057 goto error;
3058 if (!(_mysql_IntegrityError =
taking False path
3059 _mysql_NewException(dict, edict, "IntegrityError")))
when _mysql_NewException() succeeds
3060 goto error;
3061 if (!(_mysql_InternalError =
taking False path
3062 _mysql_NewException(dict, edict, "InternalError")))
when _mysql_NewException() succeeds
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
taking False path
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
when _mysql_NewException() succeeds
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
taking False path
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
when _mysql_NewException() succeeds
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
when PyString_FromString() succeeds
taking False path
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
when PyDict_SetItemString() succeeds
3073 error:
3074 if (emod) Py_DECREF(emod);
taking True path
when taking True path
3075 if (PyErr_Occurred()) {
PyErr_Occurred()
taking False path
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | memory leak: ob_refcnt of new ref from (unknown) PyUnicodeUCS4_FromString is 1 too high |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
returning
memory leak: ob_refcnt of new ref from (unknown) PyUnicodeUCS4_FromString is 1 too high
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
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
new ref from (unknown) PyUnicodeUCS4_FromString was allocated at: if (PyDict_SetItemString(dict, "__version__",
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() succeeds
taking False path
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
when PyImport_ImportModule() succeeds
taking False path
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
taking False path
3037 if (!(_mysql_MySQLError =
taking False path
3038 _mysql_NewException(dict, edict, "MySQLError")))
when _mysql_NewException() succeeds
3039 goto error;
3040 if (!(_mysql_Warning =
taking False path
3041 _mysql_NewException(dict, edict, "Warning")))
when _mysql_NewException() succeeds
3042 goto error;
3043 if (!(_mysql_Error =
taking False path
3044 _mysql_NewException(dict, edict, "Error")))
when _mysql_NewException() succeeds
3045 goto error;
3046 if (!(_mysql_InterfaceError =
taking False path
3047 _mysql_NewException(dict, edict, "InterfaceError")))
when _mysql_NewException() succeeds
3048 goto error;
3049 if (!(_mysql_DatabaseError =
taking False path
3050 _mysql_NewException(dict, edict, "DatabaseError")))
when _mysql_NewException() succeeds
3051 goto error;
3052 if (!(_mysql_DataError =
taking False path
3053 _mysql_NewException(dict, edict, "DataError")))
when _mysql_NewException() succeeds
3054 goto error;
3055 if (!(_mysql_OperationalError =
taking False path
3056 _mysql_NewException(dict, edict, "OperationalError")))
when _mysql_NewException() succeeds
3057 goto error;
3058 if (!(_mysql_IntegrityError =
taking False path
3059 _mysql_NewException(dict, edict, "IntegrityError")))
when _mysql_NewException() succeeds
3060 goto error;
3061 if (!(_mysql_InternalError =
taking False path
3062 _mysql_NewException(dict, edict, "InternalError")))
when _mysql_NewException() succeeds
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
taking False path
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
when _mysql_NewException() succeeds
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
taking False path
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
when _mysql_NewException() succeeds
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
when PyString_FromString() succeeds
taking False path
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
when PyDict_SetItemString() succeeds
3073 error:
3074 if (emod) Py_DECREF(emod);
taking True path
when taking True path
3075 if (PyErr_Occurred()) {
PyErr_Occurred()
taking False path
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | future use-after-free: ob_refcnt of '*module' is 1 too low |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
'*module' was allocated at: module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
ob_refcnt is now refs: 0 owned, 1 borrowed
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
returning
future use-after-free: ob_refcnt of '*module' is 1 too low
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
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() succeeds
taking False path
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
when PyImport_ImportModule() succeeds
taking False path
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
taking False path
3037 if (!(_mysql_MySQLError =
taking False path
3038 _mysql_NewException(dict, edict, "MySQLError")))
when _mysql_NewException() succeeds
3039 goto error;
3040 if (!(_mysql_Warning =
taking False path
3041 _mysql_NewException(dict, edict, "Warning")))
when _mysql_NewException() succeeds
3042 goto error;
3043 if (!(_mysql_Error =
taking False path
3044 _mysql_NewException(dict, edict, "Error")))
when _mysql_NewException() succeeds
3045 goto error;
3046 if (!(_mysql_InterfaceError =
taking False path
3047 _mysql_NewException(dict, edict, "InterfaceError")))
when _mysql_NewException() succeeds
3048 goto error;
3049 if (!(_mysql_DatabaseError =
taking False path
3050 _mysql_NewException(dict, edict, "DatabaseError")))
when _mysql_NewException() succeeds
3051 goto error;
3052 if (!(_mysql_DataError =
taking False path
3053 _mysql_NewException(dict, edict, "DataError")))
when _mysql_NewException() succeeds
3054 goto error;
3055 if (!(_mysql_OperationalError =
taking False path
3056 _mysql_NewException(dict, edict, "OperationalError")))
when _mysql_NewException() succeeds
3057 goto error;
3058 if (!(_mysql_IntegrityError =
taking False path
3059 _mysql_NewException(dict, edict, "IntegrityError")))
when _mysql_NewException() succeeds
3060 goto error;
3061 if (!(_mysql_InternalError =
taking False path
3062 _mysql_NewException(dict, edict, "InternalError")))
when _mysql_NewException() succeeds
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
taking False path
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
when _mysql_NewException() succeeds
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
taking False path
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
when _mysql_NewException() succeeds
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
when PyString_FromString() succeeds
taking False path
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
when PyDict_SetItemString() fails
3073 error:
3074 if (emod) Py_DECREF(emod);
taking True path
when taking True path
3075 if (PyErr_Occurred()) {
PyErr_Occurred()
taking True path
3076 PyErr_SetString(PyExc_ImportError,
calling PyErr_SetString()
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
taking True path
when taking True path
ob_refcnt is now refs: -1 owned, 1 borrowed
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | comparison against uninitialized data (emod) at _mysql.c:3074 |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() succeeds
when PyDict_SetItemString() succeeds
taking False path
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
when PyDict_SetItemString() succeeds
taking False path
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
when PyDict_SetItemString() fails
taking True path
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
3037 if (!(_mysql_MySQLError =
3038 _mysql_NewException(dict, edict, "MySQLError")))
3039 goto error;
3040 if (!(_mysql_Warning =
3041 _mysql_NewException(dict, edict, "Warning")))
3042 goto error;
3043 if (!(_mysql_Error =
3044 _mysql_NewException(dict, edict, "Error")))
3045 goto error;
3046 if (!(_mysql_InterfaceError =
3047 _mysql_NewException(dict, edict, "InterfaceError")))
3048 goto error;
3049 if (!(_mysql_DatabaseError =
3050 _mysql_NewException(dict, edict, "DatabaseError")))
3051 goto error;
3052 if (!(_mysql_DataError =
3053 _mysql_NewException(dict, edict, "DataError")))
3054 goto error;
3055 if (!(_mysql_OperationalError =
3056 _mysql_NewException(dict, edict, "OperationalError")))
3057 goto error;
3058 if (!(_mysql_IntegrityError =
3059 _mysql_NewException(dict, edict, "IntegrityError")))
3060 goto error;
3061 if (!(_mysql_InternalError =
3062 _mysql_NewException(dict, edict, "InternalError")))
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
3073 error:
3074 if (emod) Py_DECREF(emod);
comparison against uninitialized data (emod) at _mysql.c:3074
found 3 similar trace(s) to this
3075 if (PyErr_Occurred()) {
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | calling PyDict_SetItemString with NULL as argument 3 (D.15967) at _mysql.c:3021 |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() succeeds
when PyDict_SetItemString() succeeds
taking False path
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
when PyUnicodeUCS4_FromString() fails
calling PyDict_SetItemString with NULL as argument 3 (D.15967) at _mysql.c:3021
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
3037 if (!(_mysql_MySQLError =
3038 _mysql_NewException(dict, edict, "MySQLError")))
3039 goto error;
3040 if (!(_mysql_Warning =
3041 _mysql_NewException(dict, edict, "Warning")))
3042 goto error;
3043 if (!(_mysql_Error =
3044 _mysql_NewException(dict, edict, "Error")))
3045 goto error;
3046 if (!(_mysql_InterfaceError =
3047 _mysql_NewException(dict, edict, "InterfaceError")))
3048 goto error;
3049 if (!(_mysql_DatabaseError =
3050 _mysql_NewException(dict, edict, "DatabaseError")))
3051 goto error;
3052 if (!(_mysql_DataError =
3053 _mysql_NewException(dict, edict, "DataError")))
3054 goto error;
3055 if (!(_mysql_OperationalError =
3056 _mysql_NewException(dict, edict, "OperationalError")))
3057 goto error;
3058 if (!(_mysql_IntegrityError =
3059 _mysql_NewException(dict, edict, "IntegrityError")))
3060 goto error;
3061 if (!(_mysql_InternalError =
3062 _mysql_NewException(dict, edict, "InternalError")))
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
3073 error:
3074 if (emod) Py_DECREF(emod);
3075 if (PyErr_Occurred()) {
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }
File: | _mysql.c |
Function: | init_mysql |
Error: | calling PyDict_SetItemString with NULL as argument 3 (D.15964) at _mysql.c:3017 |
2981 DL_EXPORT(void)
2982 init_mysql(void)
2983 #endif
2984 {
2985 PyObject *dict, *module, *emod, *edict;
2986
2987 utf8conn = mysql_init(NULL);
2988 utf8conn->charset = &my_charset_utf8mb4_unicode_ci;
when treating unknown struct MYSQL * from _mysql.c:2987 as non-NULL
2989
2990 #ifdef IS_PY3K
2991 module = PyModule_Create(&_mysqlmodule);
2992 if (!module) return module; /* this really should never happen */
2993 #else
2994 module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
when Py_InitModule4_64() succeeds
2995 (PyObject *)NULL, PYTHON_API_VERSION);
2996 if (!module) return; /* this really should never happen */
taking False path
2997 #endif
2998 #ifdef IS_PY3K
2999 Py_TYPE(&_mysql_ConnectionObject_Type) = &PyType_Type;
3000 Py_TYPE(&_mysql_ResultObject_Type) = &PyType_Type;
3001 #else
3002 _mysql_ConnectionObject_Type.ob_type = &PyType_Type;
3003 _mysql_ResultObject_Type.ob_type = &PyType_Type;
3004 #endif
3005 #if PY_VERSION_HEX >= 0x02020000
3006 _mysql_ConnectionObject_Type.tp_alloc = PyType_GenericAlloc;
3007 _mysql_ResultObject_Type.tp_alloc = PyType_GenericAlloc;
3008 _mysql_ConnectionObject_Type.tp_new = PyType_GenericNew;
3009 _mysql_ResultObject_Type.tp_new = PyType_GenericNew;
3010 #ifndef IS_PY3K
3011 _mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
3012 _mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
3013 #endif
3014 #endif
3015
3016 if (!(dict = PyModule_GetDict(module))) goto error;
taking False path
3017 if (PyDict_SetItemString(dict, "version_info",
when PyRun_StringFlags() fails
calling PyDict_SetItemString with NULL as argument 3 (D.15964) at _mysql.c:3017
3018 PyRun_String(QUOTE(version_info), Py_eval_input,
3019 dict, dict)))
3020 goto error;
3021 if (PyDict_SetItemString(dict, "__version__",
3022 PyUnicode_FromString(QUOTE(__version__))))
3023 goto error;
3024 if (PyDict_SetItemString(dict, "connection",
3025 (PyObject *)&_mysql_ConnectionObject_Type))
3026 goto error;
3027 Py_INCREF(&_mysql_ConnectionObject_Type);
3028 if (PyDict_SetItemString(dict, "result",
3029 (PyObject *)&_mysql_ResultObject_Type))
3030 goto error;
3031 Py_INCREF(&_mysql_ResultObject_Type);
3032 if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
3033 PyErr_Print();
3034 goto error;
3035 }
3036 if (!(edict = PyModule_GetDict(emod))) goto error;
3037 if (!(_mysql_MySQLError =
3038 _mysql_NewException(dict, edict, "MySQLError")))
3039 goto error;
3040 if (!(_mysql_Warning =
3041 _mysql_NewException(dict, edict, "Warning")))
3042 goto error;
3043 if (!(_mysql_Error =
3044 _mysql_NewException(dict, edict, "Error")))
3045 goto error;
3046 if (!(_mysql_InterfaceError =
3047 _mysql_NewException(dict, edict, "InterfaceError")))
3048 goto error;
3049 if (!(_mysql_DatabaseError =
3050 _mysql_NewException(dict, edict, "DatabaseError")))
3051 goto error;
3052 if (!(_mysql_DataError =
3053 _mysql_NewException(dict, edict, "DataError")))
3054 goto error;
3055 if (!(_mysql_OperationalError =
3056 _mysql_NewException(dict, edict, "OperationalError")))
3057 goto error;
3058 if (!(_mysql_IntegrityError =
3059 _mysql_NewException(dict, edict, "IntegrityError")))
3060 goto error;
3061 if (!(_mysql_InternalError =
3062 _mysql_NewException(dict, edict, "InternalError")))
3063 goto error;
3064 if (!(_mysql_ProgrammingError =
3065 _mysql_NewException(dict, edict, "ProgrammingError")))
3066 goto error;
3067 if (!(_mysql_NotSupportedError =
3068 _mysql_NewException(dict, edict, "NotSupportedError")))
3069 goto error;
3070 if (!(_mysql_NULL = PyBytes_FromString("NULL")))
3071 goto error;
3072 if (PyDict_SetItemString(dict, "NULL", _mysql_NULL)) goto error;
3073 error:
3074 if (emod) Py_DECREF(emod);
3075 if (PyErr_Occurred()) {
3076 PyErr_SetString(PyExc_ImportError,
3077 "_mysql: init failed");
3078 if (module) Py_DECREF(module);
3079 module = NULL;
3080 }
3081 #ifdef IS_PY3K
3082 return module;
3083 #endif
3084 }