File: acl.c
Function: Entry_str
Error: ob_refcnt of return value is 1 too low
700 /* Converts the entry to a text format */
701 static PyObject* Entry_str(PyObject *obj) {
702     acl_tag_t tag;
703     uid_t qualifier;
704     void *p;
705     PyObject *format, *kind;
706     Entry_Object *self = (Entry_Object*) obj;
707 
708     if(acl_get_tag_type(self->entry, &tag) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
709         PyErr_SetFromErrno(PyExc_IOError);
710         return NULL;
711     }
712     if(tag == ACL_USER || tag == ACL_GROUP) {
taking True path
713         if((p = acl_get_qualifier(self->entry)) == NULL) {
when treating unknown void * from acl.c:713 as non-NULL
taking False path
714             PyErr_SetFromErrno(PyExc_IOError);
715             return NULL;
716         }
717         qualifier = *(uid_t*)p;
718         acl_free(p);
719     } else {
720         qualifier = 0;
721     }
722 
723     format = PyBytes_FromString("ACL entry for ");
when PyString_FromString() succeeds
724     if(format == NULL)
taking False path
725         return NULL;
726     if(tag == ACL_UNDEFINED_TAG) {
when taking False path
727         kind = PyBytes_FromString("undefined type");
728     } else if(tag == ACL_USER_OBJ) {
when taking False path
729         kind = PyBytes_FromString("the owner");
730     } else if(tag == ACL_GROUP_OBJ) {
when taking True path
731         kind = PyBytes_FromString("the group");
when PyString_FromString() succeeds
732     } else if(tag == ACL_OTHER) {
733         kind = PyBytes_FromString("the others");
734     } else if(tag == ACL_USER) {
735         kind = PyBytes_FromFormat("user with uid %d", qualifier);
736     } else if(tag == ACL_GROUP) {
737         kind = PyBytes_FromFormat("group with gid %d", qualifier);
738     } else if(tag == ACL_MASK) {
739         kind = PyBytes_FromString("the mask");
740     } else {
741         kind = PyBytes_FromString("UNKNOWN_TAG_TYPE!");
742     }
743     if (kind == NULL)
taking False path
744         return NULL;
745     PyBytes_ConcatAndDel(&format, kind);
result of PyString_Concat allocated at:     PyBytes_ConcatAndDel(&format, kind);
746     Py_DECREF(format);
when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)
when taking True path
ob_refcnt is now refs: 0 + N where N >= 0
747     return format;
748 }
ob_refcnt of return value is 1 too low
was expecting final ob_refcnt to be N + 1 (for some unknown N)
due to object being referenced by: return value
but final ob_refcnt is N + 0
found 10 similar trace(s) to this

File: acl.c
Function: Entry_str
Error: returning pointer to deallocated memory
700 /* Converts the entry to a text format */
701 static PyObject* Entry_str(PyObject *obj) {
702     acl_tag_t tag;
703     uid_t qualifier;
704     void *p;
705     PyObject *format, *kind;
706     Entry_Object *self = (Entry_Object*) obj;
707 
708     if(acl_get_tag_type(self->entry, &tag) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
709         PyErr_SetFromErrno(PyExc_IOError);
710         return NULL;
711     }
712     if(tag == ACL_USER || tag == ACL_GROUP) {
taking True path
713         if((p = acl_get_qualifier(self->entry)) == NULL) {
when treating unknown void * from acl.c:713 as non-NULL
taking False path
714             PyErr_SetFromErrno(PyExc_IOError);
715             return NULL;
716         }
717         qualifier = *(uid_t*)p;
718         acl_free(p);
719     } else {
720         qualifier = 0;
721     }
722 
723     format = PyBytes_FromString("ACL entry for ");
when PyString_FromString() succeeds
724     if(format == NULL)
taking False path
725         return NULL;
726     if(tag == ACL_UNDEFINED_TAG) {
when taking False path
727         kind = PyBytes_FromString("undefined type");
728     } else if(tag == ACL_USER_OBJ) {
when taking False path
729         kind = PyBytes_FromString("the owner");
730     } else if(tag == ACL_GROUP_OBJ) {
when taking True path
731         kind = PyBytes_FromString("the group");
when PyString_FromString() succeeds
732     } else if(tag == ACL_OTHER) {
733         kind = PyBytes_FromString("the others");
734     } else if(tag == ACL_USER) {
735         kind = PyBytes_FromFormat("user with uid %d", qualifier);
736     } else if(tag == ACL_GROUP) {
737         kind = PyBytes_FromFormat("group with gid %d", qualifier);
738     } else if(tag == ACL_MASK) {
739         kind = PyBytes_FromString("the mask");
740     } else {
741         kind = PyBytes_FromString("UNKNOWN_TAG_TYPE!");
742     }
743     if (kind == NULL)
taking False path
744         return NULL;
745     PyBytes_ConcatAndDel(&format, kind);
746     Py_DECREF(format);
when PyString_Concat() succeeds (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)
when taking False path
calling tp_dealloc on result of PyString_Concat allocated at acl.c:745
memory deallocated here
747     return format;
748 }
returning pointer to deallocated memory
found 10 similar trace(s) to this

File: acl.c
Function: Entry_str
Error: dereferencing NULL (format.74->ob_refcnt) at acl.c:746
700 /* Converts the entry to a text format */
701 static PyObject* Entry_str(PyObject *obj) {
702     acl_tag_t tag;
703     uid_t qualifier;
704     void *p;
705     PyObject *format, *kind;
706     Entry_Object *self = (Entry_Object*) obj;
707 
708     if(acl_get_tag_type(self->entry, &tag) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
709         PyErr_SetFromErrno(PyExc_IOError);
710         return NULL;
711     }
712     if(tag == ACL_USER || tag == ACL_GROUP) {
taking True path
713         if((p = acl_get_qualifier(self->entry)) == NULL) {
when treating unknown void * from acl.c:713 as non-NULL
taking False path
714             PyErr_SetFromErrno(PyExc_IOError);
715             return NULL;
716         }
717         qualifier = *(uid_t*)p;
718         acl_free(p);
719     } else {
720         qualifier = 0;
721     }
722 
723     format = PyBytes_FromString("ACL entry for ");
when PyString_FromString() succeeds
724     if(format == NULL)
taking False path
725         return NULL;
726     if(tag == ACL_UNDEFINED_TAG) {
when taking False path
727         kind = PyBytes_FromString("undefined type");
728     } else if(tag == ACL_USER_OBJ) {
when taking True path
729         kind = PyBytes_FromString("the owner");
when PyString_FromString() succeeds
730     } else if(tag == ACL_GROUP_OBJ) {
731         kind = PyBytes_FromString("the group");
732     } else if(tag == ACL_OTHER) {
733         kind = PyBytes_FromString("the others");
734     } else if(tag == ACL_USER) {
735         kind = PyBytes_FromFormat("user with uid %d", qualifier);
736     } else if(tag == ACL_GROUP) {
737         kind = PyBytes_FromFormat("group with gid %d", qualifier);
738     } else if(tag == ACL_MASK) {
739         kind = PyBytes_FromString("the mask");
740     } else {
741         kind = PyBytes_FromString("UNKNOWN_TAG_TYPE!");
742     }
743     if (kind == NULL)
taking False path
744         return NULL;
745     PyBytes_ConcatAndDel(&format, kind);
746     Py_DECREF(format);
when PyString_Concat() fails (Py_DECREF() without deallocation on *LHS) (Py_DECREF() without deallocation on RHS)
dereferencing NULL (format.74->ob_refcnt) at acl.c:746
found 7 similar trace(s) to this
747     return format;
748 }

File: acl.c
Function: Entry_str
Error: ob_refcnt of '*format' is 1 too high
700 /* Converts the entry to a text format */
701 static PyObject* Entry_str(PyObject *obj) {
702     acl_tag_t tag;
703     uid_t qualifier;
704     void *p;
705     PyObject *format, *kind;
706     Entry_Object *self = (Entry_Object*) obj;
707 
708     if(acl_get_tag_type(self->entry, &tag) == -1) {
when considering range: -0x80000000 <= value <= -2
taking False path
709         PyErr_SetFromErrno(PyExc_IOError);
710         return NULL;
711     }
712     if(tag == ACL_USER || tag == ACL_GROUP) {
taking True path
713         if((p = acl_get_qualifier(self->entry)) == NULL) {
when treating unknown void * from acl.c:713 as non-NULL
taking False path
714             PyErr_SetFromErrno(PyExc_IOError);
715             return NULL;
716         }
717         qualifier = *(uid_t*)p;
718         acl_free(p);
719     } else {
720         qualifier = 0;
721     }
722 
723     format = PyBytes_FromString("ACL entry for ");
when PyString_FromString() succeeds
PyStringObject allocated at:     format = PyBytes_FromString("ACL entry for ");
ob_refcnt is now refs: 1 + N where N >= 0
724     if(format == NULL)
taking False path
725         return NULL;
726     if(tag == ACL_UNDEFINED_TAG) {
when taking False path
727         kind = PyBytes_FromString("undefined type");
728     } else if(tag == ACL_USER_OBJ) {
when taking True path
729         kind = PyBytes_FromString("the owner");
when PyString_FromString() fails
730     } else if(tag == ACL_GROUP_OBJ) {
731         kind = PyBytes_FromString("the group");
732     } else if(tag == ACL_OTHER) {
733         kind = PyBytes_FromString("the others");
734     } else if(tag == ACL_USER) {
735         kind = PyBytes_FromFormat("user with uid %d", qualifier);
736     } else if(tag == ACL_GROUP) {
737         kind = PyBytes_FromFormat("group with gid %d", qualifier);
738     } else if(tag == ACL_MASK) {
739         kind = PyBytes_FromString("the mask");
740     } else {
741         kind = PyBytes_FromString("UNKNOWN_TAG_TYPE!");
742     }
743     if (kind == NULL)
taking True path
744         return NULL;
745     PyBytes_ConcatAndDel(&format, kind);
746     Py_DECREF(format);
747     return format;
748 }
ob_refcnt of '*format' 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 1 similar trace(s) to this