File: src/python/pyhbac.c
Function: str_concat_sequence
Error: ob_refcnt of '*item' is 1 too high
221 static char *
222 str_concat_sequence(PyObject *seq, const char *delim)
223 {
224     Py_ssize_t size;
225     Py_ssize_t i;
226     PyObject *item;
227     char *s = NULL;
228     char *part;
229 
230     size = PySequence_Size(seq);
231 
232     if (size == 0) {
when considering range: 1 <= value <= 0x7fffffffffffffff
taking False path
233         s = py_strdup("");
234         if (s == NULL) {
235             return NULL;
236         }
237         return s;
238     }
239 
240     for (i=0; i < size; i++) {
taking True path
241         item = PySequence_GetItem(seq, i);
when PySequence_GetItem() succeeds
new ref from PySequence_GetItem allocated at:         item = PySequence_GetItem(seq, i);
ob_refcnt is now refs: 1 + N where N >= 0
242         if (item == NULL) goto fail;
taking False path
243 
244         part = PyString_AsString(item);
when PyString_AsString() succeeds
245         if (part == NULL) {
taking False path
246             Py_DECREF(item);
247             goto fail;
248         }
249 
250         if (s) {
taking False path
251             s = py_strcat_realloc(s, delim);
252             if (s == NULL) goto fail;
253             s = py_strcat_realloc(s, part);
254             if (s == NULL) goto fail;
255         } else {
256             s = py_strdup(part);
257             if (s == NULL) goto fail;
when treating unknown char * from src/python/pyhbac.c:256 as NULL
taking True path
258         }
259         Py_DECREF(item);
260     }
261 
262     return s;
263 fail:
264     PyMem_Free(s);
calling PyMem_Free on NULL
265     return NULL;
266 }
ob_refcnt of '*item' is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1