File: ./libxml.c
Function: libxml_xmlTextReaderGetErrorHandler
Error: calling PyTuple_SetItem with NULL as argument 1 (py_retval) at ./libxml.c:2010
1992 static PyObject *
1993 libxml_xmlTextReaderGetErrorHandler(ATTRIBUTE_UNUSED PyObject *self, PyObject *args)
1994 {
1995     xmlTextReaderPtr reader;
1996     xmlTextReaderPyCtxtPtr pyCtxt;
1997     xmlTextReaderErrorFunc f;
1998     void *arg;
1999     PyObject *pyobj_reader;
2000     PyObject *py_retval;
2001 
2002     if (!PyArg_ParseTuple(args, (char *)"O:xmlTextReaderSetErrorHandler", &pyobj_reader))
when PyArg_ParseTuple() succeeds
taking False path
2003         return(NULL);
2004     reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader);
taking True path
2005     xmlTextReaderGetErrorHandler(reader,&f,&arg);
2006     py_retval = PyTuple_New(2);
when PyTuple_New() fails
2007     if (f == (xmlTextReaderErrorFunc)libxml_xmlTextReaderErrorCallback) {
when taking True path
2008 	/* ok, it's our error handler! */
2009 	pyCtxt = (xmlTextReaderPyCtxtPtr)arg;
2010 	PyTuple_SetItem(py_retval, 0, pyCtxt->f);
when treating unknown void * * from ./libxml.c:2005 as non-NULL
calling PyTuple_SetItem with NULL as argument 1 (py_retval) at ./libxml.c:2010
PyTuple_SetItem() invokes Py_TYPE() on the pointer via the PyTuple_Check() macro, thus accessing (NULL)->ob_type
2011 	Py_XINCREF(pyCtxt->f);
2012 	PyTuple_SetItem(py_retval, 1, pyCtxt->arg);
2013 	Py_XINCREF(pyCtxt->arg);
2014     }
2015     else
2016     {
2017 	/* f is null or it's not our error handler */
2018 	PyTuple_SetItem(py_retval, 0, Py_None);
2019 	Py_XINCREF(Py_None);
2020 	PyTuple_SetItem(py_retval, 1, Py_None);
2021 	Py_XINCREF(Py_None);
2022     }
2023     return(py_retval);
2024 }

File: ./libxml.c
Function: libxml_xmlTextReaderGetErrorHandler
Error: calling PyTuple_SetItem with NULL as argument 1 (py_retval) at ./libxml.c:2018
1992 static PyObject *
1993 libxml_xmlTextReaderGetErrorHandler(ATTRIBUTE_UNUSED PyObject *self, PyObject *args)
1994 {
1995     xmlTextReaderPtr reader;
1996     xmlTextReaderPyCtxtPtr pyCtxt;
1997     xmlTextReaderErrorFunc f;
1998     void *arg;
1999     PyObject *pyobj_reader;
2000     PyObject *py_retval;
2001 
2002     if (!PyArg_ParseTuple(args, (char *)"O:xmlTextReaderSetErrorHandler", &pyobj_reader))
when PyArg_ParseTuple() succeeds
taking False path
2003         return(NULL);
2004     reader = (xmlTextReaderPtr) PyxmlTextReader_Get(pyobj_reader);
taking True path
2005     xmlTextReaderGetErrorHandler(reader,&f,&arg);
2006     py_retval = PyTuple_New(2);
when PyTuple_New() fails
2007     if (f == (xmlTextReaderErrorFunc)libxml_xmlTextReaderErrorCallback) {
when taking False path
2008 	/* ok, it's our error handler! */
2009 	pyCtxt = (xmlTextReaderPyCtxtPtr)arg;
2010 	PyTuple_SetItem(py_retval, 0, pyCtxt->f);
2011 	Py_XINCREF(pyCtxt->f);
2012 	PyTuple_SetItem(py_retval, 1, pyCtxt->arg);
2013 	Py_XINCREF(pyCtxt->arg);
2014     }
2015     else
2016     {
2017 	/* f is null or it's not our error handler */
2018 	PyTuple_SetItem(py_retval, 0, Py_None);
calling PyTuple_SetItem with NULL as argument 1 (py_retval) at ./libxml.c:2018
PyTuple_SetItem() invokes Py_TYPE() on the pointer via the PyTuple_Check() macro, thus accessing (NULL)->ob_type
2019 	Py_XINCREF(Py_None);
2020 	PyTuple_SetItem(py_retval, 1, Py_None);
2021 	Py_XINCREF(Py_None);
2022     }
2023     return(py_retval);
2024 }