File: ./libxml.c
Function: pythonExternalEntityLoader
Error: ob_refcnt of '*ret' is 1 too low
652 static xmlParserInputPtr
653 pythonExternalEntityLoader(const char *URL, const char *ID,
654 			   xmlParserCtxtPtr ctxt) {
655     xmlParserInputPtr result = NULL;
656     if (pythonExternalEntityLoaderObjext != NULL) {
when treating unknown struct PyObject * from ./libxml.c:650 as non-NULL
taking True path
657 	PyObject *ret;
658 	PyObject *ctxtobj;
659 
660 	ctxtobj = libxml_xmlParserCtxtPtrWrap(ctxt);
when libxml_xmlParserCtxtPtrWrap() succeeds
661 #ifdef DEBUG_LOADER
662 	printf("pythonExternalEntityLoader: ready to call\n");
663 #endif
664 
665 	ret = PyObject_CallFunction(pythonExternalEntityLoaderObjext,
when PyObject_CallFunction() succeeds
new ref from call to PyObject_CallFunction allocated at: 	ret = PyObject_CallFunction(pythonExternalEntityLoaderObjext,
ob_refcnt is now refs: 1 + N where N >= 0
666 		      (char *) "(ssO)", URL, ID, ctxtobj);
667 	Py_XDECREF(ctxtobj);
taking False path
when taking False path
calling tp_dealloc on new ref from (unknown) libxml_xmlParserCtxtPtrWrap allocated at ./libxml.c:660
668 #ifdef DEBUG_LOADER
669 	printf("pythonExternalEntityLoader: result ");
670 	PyObject_Print(ret, stderr, 0);
671 	printf("\n");
672 #endif
673 
674 	if (ret != NULL) {
taking True path
675 	    if (PyObject_HasAttrString(ret, (char *) "read")) {
when PyObject_HasAttrString() returns 1 (true)
taking True path
676 		xmlParserInputBufferPtr buf;
677 
678 		buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
679 		if (buf != NULL) {
when treating unknown struct xmlParserInputBuffer * from ./libxml.c:678 as non-NULL
taking True path
680 		    buf->context = ret;
'*ret' is now referenced by 1 non-stack value(s): heap-region-425.context
681 		    buf->readcallback = xmlPythonFileReadRaw;
682 		    buf->closecallback = xmlPythonFileCloseRaw;
683 		    result = xmlNewIOInputStream(ctxt, buf,
684 			                         XML_CHAR_ENCODING_NONE);
685 		}
686 #if 0
687 	    } else {
688 		if (URL != NULL)
689 		    printf("pythonExternalEntityLoader: can't read %s\n",
690 		           URL);
691 #endif
692 	    }
693 	    if (result == NULL) {
when treating unknown struct xmlParserInput * from ./libxml.c:683 as NULL
taking True path
694 		Py_DECREF(ret);
when taking True path
ob_refcnt is now refs: 0 + N where N >= 0
695 	    } else if (URL != NULL) {
696 		result->filename = (char *) xmlStrdup((const xmlChar *)URL);
697 		result->directory = xmlParserGetDirectory((const char *) URL);
698 	    }
699 	}
700     }
701     if ((result == NULL) && (defaultExternalEntityLoader != NULL)) {
taking True path
when treating unknown struct xmlParserInput * (*xmlExternalEntityLoader) (const char *, const char *, struct xmlParserCtxt *) from ./libxml.c:649 as non-NULL
taking True path
702 	result = defaultExternalEntityLoader(URL, ID, ctxt);
calling (struct xmlParserInput * (*xmlExternalEntityLoader) (const char *, const char *, struct xmlParserCtxt *))&Region('heap-region-427') from ./libxml.c:701
703     }
704     return(result);
returning
ob_refcnt of '*ret' 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-425.context
but final ob_refcnt is N + 0
found 3 similar trace(s) to this
705 }