File: plpython.c
Function: PLy_generate_spi_exceptions
Error: ob_refcnt of '*dict' is 1 too high
3957 static void
3958 PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
3959 {
3960 	int			i;
3961 
3962 	for (i = 0; exception_map[i].name != NULL; i++)
when treating unknown char * const from plpython.c:3962 as non-NULL
taking True path
when treating unknown char * const from plpython.c:3962 as NULL
taking False path
3963 	{
3964 		bool		found;
3965 		PyObject   *exc;
3966 		PLyExceptionEntry *entry;
3967 		PyObject   *sqlstate;
3968 		PyObject   *dict = PyDict_New();
when PyDict_New() succeeds
PyDictObject allocated at: 		PyObject   *dict = PyDict_New();
ob_refcnt is now refs: 1 + N where N >= 0
3969 
3970 		sqlstate = PyString_FromString(unpack_sql_state(exception_map[i].sqlstate));
when treating unknown char * from plpython.c:3970 as non-NULL
when PyString_FromString() succeeds
3971 		PyDict_SetItemString(dict, "sqlstate", sqlstate);
when PyDict_SetItemString() succeeds
3972 		Py_DECREF(sqlstate);
when taking True path
3973 		exc = PyErr_NewException(exception_map[i].name, base, dict);
when treating unknown char * const from plpython.c:3973 as non-NULL
when PyErr_NewException() succeeds
3974 		PyModule_AddObject(mod, exception_map[i].classname, exc);
when PyModule_AddObject() succeeds
3975 		entry = hash_search(PLy_spi_exceptions, &exception_map[i].sqlstate,
3976 							HASH_ENTER, &found);
3977 		entry->exc = exc;
when treating unknown void * from plpython.c:3975 as non-NULL
3978 		Assert(!found);
3979 	}
3980 }
returning
ob_refcnt of '*dict' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1
found 11 similar trace(s) to this

File: plpython.c
Function: PLy_generate_spi_exceptions
Error: ob_refcnt of '*exc' is 1 too low
3957 static void
3958 PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
3959 {
3960 	int			i;
3961 
3962 	for (i = 0; exception_map[i].name != NULL; i++)
when treating unknown char * const from plpython.c:3962 as non-NULL
taking True path
when treating unknown char * const from plpython.c:3962 as NULL
taking False path
3963 	{
3964 		bool		found;
3965 		PyObject   *exc;
3966 		PLyExceptionEntry *entry;
3967 		PyObject   *sqlstate;
3968 		PyObject   *dict = PyDict_New();
when PyDict_New() succeeds
3969 
3970 		sqlstate = PyString_FromString(unpack_sql_state(exception_map[i].sqlstate));
when treating unknown char * from plpython.c:3970 as non-NULL
when PyString_FromString() succeeds
3971 		PyDict_SetItemString(dict, "sqlstate", sqlstate);
when PyDict_SetItemString() succeeds
3972 		Py_DECREF(sqlstate);
when taking True path
3973 		exc = PyErr_NewException(exception_map[i].name, base, dict);
when treating unknown char * const from plpython.c:3973 as non-NULL
when PyErr_NewException() succeeds
new exception object from PyErr_NewException allocated at: 		exc = PyErr_NewException(exception_map[i].name, base, dict);
ob_refcnt is now refs: 1 + N where N >= 0
3974 		PyModule_AddObject(mod, exception_map[i].classname, exc);
when PyModule_AddObject() succeeds
ob_refcnt is now refs: 0 + N where N >= 1
3975 		entry = hash_search(PLy_spi_exceptions, &exception_map[i].sqlstate,
3976 							HASH_ENTER, &found);
3977 		entry->exc = exc;
when treating unknown void * from plpython.c:3975 as non-NULL
'*exc' is now referenced by 1 non-stack value(s): heap-region-239.exc
3978 		Assert(!found);
3979 	}
3980 }
returning
ob_refcnt of '*exc' is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: heap-region-239.exc
but final ob_refcnt is N + 0
found 3 similar trace(s) to this

File: plpython.c
Function: PLy_generate_spi_exceptions
Error: calling PyDict_SetItemString with NULL as argument 3 (sqlstate) at plpython.c:3971
3957 static void
3958 PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
3959 {
3960 	int			i;
3961 
3962 	for (i = 0; exception_map[i].name != NULL; i++)
when treating unknown char * const from plpython.c:3962 as non-NULL
taking True path
3963 	{
3964 		bool		found;
3965 		PyObject   *exc;
3966 		PLyExceptionEntry *entry;
3967 		PyObject   *sqlstate;
3968 		PyObject   *dict = PyDict_New();
when PyDict_New() succeeds
3969 
3970 		sqlstate = PyString_FromString(unpack_sql_state(exception_map[i].sqlstate));
when treating unknown char * from plpython.c:3970 as non-NULL
when PyString_FromString() fails
3971 		PyDict_SetItemString(dict, "sqlstate", sqlstate);
calling PyDict_SetItemString with NULL as argument 3 (sqlstate) at plpython.c:3971
3972 		Py_DECREF(sqlstate);
3973 		exc = PyErr_NewException(exception_map[i].name, base, dict);
3974 		PyModule_AddObject(mod, exception_map[i].classname, exc);
3975 		entry = hash_search(PLy_spi_exceptions, &exception_map[i].sqlstate,
3976 							HASH_ENTER, &found);
3977 		entry->exc = exc;
3978 		Assert(!found);
3979 	}
3980 }