File: bibtexmodule.c
Function: _bib_next
Error: ob_refcnt of '*name' is 1 too high
470 static PyObject *
471 _bib_next (PyBibtexSource_Object * file_obj, gboolean filter)
472 {
473     BibtexEntry * ent;
474     BibtexSource * file;
475 
476     PyObject * dico, * tmp, * name;
477 
478     file = file_obj->obj;
479 
480     ent = bibtex_source_next_entry (file, filter);
481 
482     if (ent == NULL) {
when treating unknown struct BibtexEntry * from bibtexmodule.c:480 as non-NULL
taking False path
483 	if (file->eof) {
484 	    Py_INCREF(Py_None);
485 	    return Py_None;
486 	}
487 
488 	return NULL;
489     }
490 
491     /* Retour de la fonction */
492     if (! filter && ! ent->name) {
when considering value == (gboolean)0 from bibtexmodule.c:471
taking True path
when treating unknown gchar * from bibtexmodule.c:492 as non-NULL
taking False path
493 	if (ent->textual_preamble) {
494 	    tmp = Py_BuildValue ("ss", ent->type, ent->textual_preamble);
495 	}
496 	else {
497 	    /* this must be a string then... */
498 	    tmp = Py_BuildValue ("(s)", ent->type);
499 	}
500     }
501     else {
502 	dico = PyDict_New (); 
when PyDict_New() succeeds
503 	
504 	g_hash_table_foreach (ent->table, fill_dico, dico);
505 	
506 	if (ent->name) {
when treating unknown gchar * from bibtexmodule.c:506 as non-NULL
taking True path
507 	    name = PyString_FromString (ent->name);
when treating unknown gchar * from bibtexmodule.c:507 as non-NULL
when PyString_FromString() succeeds
PyStringObject allocated at: 	    name = PyString_FromString (ent->name);
ob_refcnt is now refs: 1 + N where N >= 0
508 	}
509 	else {
510 	    name = Py_None;
511 	}
512 	
513 	if (filter) {
taking False path
514 	    tmp = Py_BuildValue ("OsiiO", name, ent->type, 
515 				 ent->offset, ent->start_line,
516 				 dico);
517 	}
518 	else {
519 	    tmp = Py_BuildValue ("(s(OsiiO))", "entry", name, 
when Py_BuildValue() succeeds
ob_refcnt is now refs: 1 + N where N >= 1
520 				 ent->type, 
521 				 ent->offset, ent->start_line,
522 				 dico);
523 	}
524 	    
525 	Py_DECREF (dico);
taking True path
526     }
527 
528     bibtex_entry_destroy (ent, FALSE);
529 
530     return tmp;
531 }
ob_refcnt of '*name' 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 5 similar trace(s) to this

File: bibtexmodule.c
Function: _bib_next
Error: dereferencing NULL (dico->ob_refcnt) at bibtexmodule.c:525
470 static PyObject *
471 _bib_next (PyBibtexSource_Object * file_obj, gboolean filter)
472 {
473     BibtexEntry * ent;
474     BibtexSource * file;
475 
476     PyObject * dico, * tmp, * name;
477 
478     file = file_obj->obj;
479 
480     ent = bibtex_source_next_entry (file, filter);
481 
482     if (ent == NULL) {
when treating unknown struct BibtexEntry * from bibtexmodule.c:480 as non-NULL
taking False path
483 	if (file->eof) {
484 	    Py_INCREF(Py_None);
485 	    return Py_None;
486 	}
487 
488 	return NULL;
489     }
490 
491     /* Retour de la fonction */
492     if (! filter && ! ent->name) {
when considering range: -0x80000000 <= value <= -1
taking False path
493 	if (ent->textual_preamble) {
494 	    tmp = Py_BuildValue ("ss", ent->type, ent->textual_preamble);
495 	}
496 	else {
497 	    /* this must be a string then... */
498 	    tmp = Py_BuildValue ("(s)", ent->type);
499 	}
500     }
501     else {
502 	dico = PyDict_New (); 
when PyDict_New() fails
503 	
504 	g_hash_table_foreach (ent->table, fill_dico, dico);
505 	
506 	if (ent->name) {
when treating unknown gchar * from bibtexmodule.c:506 as non-NULL
taking True path
507 	    name = PyString_FromString (ent->name);
when treating unknown gchar * from bibtexmodule.c:507 as non-NULL
when PyString_FromString() succeeds
508 	}
509 	else {
510 	    name = Py_None;
511 	}
512 	
513 	if (filter) {
taking True path
514 	    tmp = Py_BuildValue ("OsiiO", name, ent->type, 
when Py_BuildValue() fails
515 				 ent->offset, ent->start_line,
516 				 dico);
517 	}
518 	else {
519 	    tmp = Py_BuildValue ("(s(OsiiO))", "entry", name, 
520 				 ent->type, 
521 				 ent->offset, ent->start_line,
522 				 dico);
523 	}
524 	    
525 	Py_DECREF (dico);
dereferencing NULL (dico->ob_refcnt) at bibtexmodule.c:525
found 2 similar trace(s) to this
526     }
527 
528     bibtex_entry_destroy (ent, FALSE);
529 
530     return tmp;
531 }