File: player.c
Function: player_receive_cards
Error: ob_refcnt of new ref from call to Py_BuildValue is 1 too high
184 void player_receive_cards (Player *player, GList *list)
185 {
186 	/* Add the cards to the hand */
187 	cards_hand_add(player->hand, list);
188 	player_publish_hand(player);
when treating unknown struct Player * from player.c:185 as non-NULL
189 	
190 	/* call receive_cards() on the player */
191 	GList *l;
192 	PyObject *result;
193 	PyObject *cards = PyList_New(0);
194 	
when PyList_New() succeeds
195 	for (l = list; l; l = l->next)
196 	{
when treating unknown struct GList * from player.c:185 as non-NULL
taking True path
when treating unknown struct GList * from player.c:196 as NULL
taking False path
197 		Card *card = (Card*)l->data;
198 		PyList_Append(cards, Py_BuildValue("(ii)", card->suit, card->rank));
199 	} 
when treating unknown void * from player.c:198 as non-NULL
when Py_BuildValue() succeeds
when PyList_Append() succeeds
new ref from call to Py_BuildValue allocated at: 		PyList_Append(cards, Py_BuildValue("(ii)", card->suit, card->rank));
ob_refcnt is now refs: 1 + N where N >= 0
ob_refcnt is now refs: 2 + N where N >= 0
new ref from call to Py_BuildValue is now referenced by 1 non-stack value(s): PyListObject.ob_item[0]
200 	
201 	result = PyObject_CallMethod(player->ai, "receive_cards", "O", cards);
202 	if (PyErr_Occurred())
when PyObject_CallMethod() succeeds
203 	{
PyErr_Occurred()
taking False path
204 		PyErr_Print();
205 		g_assert_not_reached();
206 	}
207 	Py_DECREF(cards);
208 	Py_DECREF(result);
when taking True path
209 }
when taking True path
210 
returning ob_refcnt of new ref from call to Py_BuildValue is 1 too high was expecting final ob_refcnt to be N + 1 (for some unknown N) due to object being referenced by: PyListObject.ob_item[0] but final ob_refcnt is N + 2 found 3 similar trace(s) to this

File: player.c
Function: player_receive_cards
Error: calling PyList_Append with NULL as argument 1 (cards) at player.c:199
184 void player_receive_cards (Player *player, GList *list)
185 {
186 	/* Add the cards to the hand */
187 	cards_hand_add(player->hand, list);
188 	player_publish_hand(player);
when treating unknown struct Player * from player.c:185 as non-NULL
189 	
190 	/* call receive_cards() on the player */
191 	GList *l;
192 	PyObject *result;
193 	PyObject *cards = PyList_New(0);
194 	
when PyList_New() fails
195 	for (l = list; l; l = l->next)
196 	{
when treating unknown struct GList * from player.c:185 as non-NULL
taking True path
197 		Card *card = (Card*)l->data;
198 		PyList_Append(cards, Py_BuildValue("(ii)", card->suit, card->rank));
199 	} 
when treating unknown void * from player.c:198 as non-NULL
when Py_BuildValue() succeeds
calling PyList_Append with NULL as argument 1 (cards) at player.c:199
PyList_Append() invokes Py_TYPE() on the pointer via the PyList_Check() macro, thus accessing (NULL)->ob_type
found 1 similar trace(s) to this
200 	
201 	result = PyObject_CallMethod(player->ai, "receive_cards", "O", cards);
202 	if (PyErr_Occurred())
203 	{
204 		PyErr_Print();
205 		g_assert_not_reached();
206 	}
207 	Py_DECREF(cards);
208 	Py_DECREF(result);
209 }
210