File: bibtexmodule.c
Function: bib_set_native
Error: dereferencing NULL (MEM[(struct PyBibtexField_Object *)tmp].obj) at bibtexmodule.c:399
357 static PyObject *
358 bib_set_native (PyObject * self, PyObject * args) {
359     PyObject * tmp;
360     BibtexField * field;
361     static BibtexSource * source = NULL;
362     BibtexEntry * entry;
363     BibtexStruct * s;
364     BibtexFieldType type;
365 
366     gchar * text, * to_parse;
367 
368     if (! PyArg_ParseTuple(args, "si:set_native", & text, &type))
when PyArg_ParseTuple() succeeds
taking False path
369 	return NULL;
370 
371     /* Create new source */
372     if (source == NULL) source = bibtex_source_new ();
when treating unknown struct BibtexSource * from bibtexmodule.c:358 as non-NULL
taking False path
373 
374     /* parse as a string */
375     to_parse = g_strdup_printf ("@preamble{%s}", text);
376 
377     if (! bibtex_source_string (source, "internal string", to_parse)) {
when considering range: -0x80000000 <= value <= -1
taking False path
378 	PyErr_SetString (PyExc_IOError, 
379 			 "can't create internal string for parsing");
380 	return NULL;
381     }
382 
383     g_free (to_parse);
384 
385     entry = bibtex_source_next_entry (source, FALSE);
386 
387     if (entry == NULL) {
when treating unknown struct BibtexEntry * from bibtexmodule.c:385 as non-NULL
taking False path
388 	return NULL;
389     }
390 
391     s = bibtex_struct_copy (entry->preamble);
392     bibtex_entry_destroy (entry, TRUE);
393 
394     field = bibtex_struct_as_field (s, type);
395 
396     tmp = (PyObject *) PyObject_NEW (PyBibtexField_Object, & PyBibtexField_Type);
when PyObject_Init() fails
397     ((PyBibtexField_Object *) tmp)->obj = field;
dereferencing NULL (MEM[(struct PyBibtexField_Object *)tmp].obj) at bibtexmodule.c:399
found 3 similar trace(s) to this
398 
399     return tmp;
400 }

File: bibtexmodule.c
Function: bib_set_native
Error: returning (PyObject*)NULL without setting an exception
357 static PyObject *
358 bib_set_native (PyObject * self, PyObject * args) {
359     PyObject * tmp;
360     BibtexField * field;
361     static BibtexSource * source = NULL;
362     BibtexEntry * entry;
363     BibtexStruct * s;
364     BibtexFieldType type;
365 
366     gchar * text, * to_parse;
367 
368     if (! PyArg_ParseTuple(args, "si:set_native", & text, &type))
when PyArg_ParseTuple() succeeds
taking False path
369 	return NULL;
370 
371     /* Create new source */
372     if (source == NULL) source = bibtex_source_new ();
when treating unknown struct BibtexSource * from bibtexmodule.c:358 as non-NULL
taking False path
373 
374     /* parse as a string */
375     to_parse = g_strdup_printf ("@preamble{%s}", text);
376 
377     if (! bibtex_source_string (source, "internal string", to_parse)) {
when considering range: -0x80000000 <= value <= -1
taking False path
378 	PyErr_SetString (PyExc_IOError, 
379 			 "can't create internal string for parsing");
380 	return NULL;
381     }
382 
383     g_free (to_parse);
384 
385     entry = bibtex_source_next_entry (source, FALSE);
386 
387     if (entry == NULL) {
when treating unknown struct BibtexEntry * from bibtexmodule.c:385 as NULL
taking True path
388 	return NULL;
389     }
390 
391     s = bibtex_struct_copy (entry->preamble);
392     bibtex_entry_destroy (entry, TRUE);
393 
394     field = bibtex_struct_as_field (s, type);
395 
396     tmp = (PyObject *) PyObject_NEW (PyBibtexField_Object, & PyBibtexField_Type);
397     ((PyBibtexField_Object *) tmp)->obj = field;
398 
399     return tmp;
400 }
returning (PyObject*)NULL without setting an exception
found 3 similar trace(s) to this