File: src/python/pysss.c
Function: PySssLocalObject_new
Error: ob_refcnt of '*self' is 1 too high
740  */
741 static PyObject *PySssLocalObject_new(PyTypeObject *type,
742                                       PyObject *args,
743                                       PyObject *kwds)
744 {
745     TALLOC_CTX *mem_ctx;
746     PySssLocalObject *self;
747     char *confdb_path;
748     int ret;
749 
750     mem_ctx = talloc_new(NULL);
751     if (mem_ctx == NULL) {
when treating unknown void * from src/python/pysss.c:750 as non-NULL
taking False path
752         PyErr_NoMemory();
753         return NULL;
754     }
755 
756     self = (PySssLocalObject *) type->tp_alloc(type, 0);
when call succeeds
new ref from call through function pointer allocated at:     self = (PySssLocalObject *) type->tp_alloc(type, 0);
ob_refcnt is now refs: 1 + N where N >= 0
757     if (self == NULL) {
taking False path
758         talloc_free(mem_ctx);
759         PyErr_NoMemory();
760         return NULL;
761     }
762     self->mem_ctx = mem_ctx;
763 
764     confdb_path = talloc_asprintf(self->mem_ctx, "%s/%s", DB_PATH, CONFDB_FILE);
765     if (confdb_path == NULL) {
when treating unknown char * from src/python/pysss.c:764 as non-NULL
taking False path
766         talloc_free(mem_ctx);
767         PyErr_NoMemory();
768         return NULL;
769     }
770 
771     /* Connect to the conf db */
772     ret = confdb_init(self->mem_ctx, &self->confdb, confdb_path);
773     if (ret != EOK) {
when considering range: -0x80000000 <= value <= -1
taking True path
774         talloc_free(mem_ctx);
775         PyErr_SetSssErrorWithMessage(ret,
776                 "Could not initialize connection to the confdb\n");
777         return NULL;
778     }
779 
780     ret = confdb_get_domain(self->confdb, "local", &self->local);
781     if (ret != EOK) {
782         talloc_free(mem_ctx);
783         PyErr_SetSssErrorWithMessage(ret, "Cannot get local domain");
784         return NULL;
785     }
786 
787     /* open 'local' sysdb at default path */
788     ret = sysdb_domain_init(self->mem_ctx, self->local, DB_PATH, &self->sysdb);
789     if (ret != EOK) {
790         talloc_free(mem_ctx);
791         PyErr_SetSssErrorWithMessage(ret,
792                 "Could not initialize connection to the sysdb\n");
793         return NULL;
794     }
795 
796     self->lock = DO_LOCK;
797     self->unlock = DO_UNLOCK;
798 
799     return (PyObject *) self;
800 }
ob_refcnt of '*self' 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 6 similar trace(s) to this

File: src/python/pysss.c
Function: PySssLocalObject_new
Error: returning (PyObject*)NULL without setting an exception
740  */
741 static PyObject *PySssLocalObject_new(PyTypeObject *type,
742                                       PyObject *args,
743                                       PyObject *kwds)
744 {
745     TALLOC_CTX *mem_ctx;
746     PySssLocalObject *self;
747     char *confdb_path;
748     int ret;
749 
750     mem_ctx = talloc_new(NULL);
751     if (mem_ctx == NULL) {
when treating unknown void * from src/python/pysss.c:750 as non-NULL
taking False path
752         PyErr_NoMemory();
753         return NULL;
754     }
755 
756     self = (PySssLocalObject *) type->tp_alloc(type, 0);
when call succeeds
757     if (self == NULL) {
taking False path
758         talloc_free(mem_ctx);
759         PyErr_NoMemory();
760         return NULL;
761     }
762     self->mem_ctx = mem_ctx;
763 
764     confdb_path = talloc_asprintf(self->mem_ctx, "%s/%s", DB_PATH, CONFDB_FILE);
765     if (confdb_path == NULL) {
when treating unknown char * from src/python/pysss.c:764 as non-NULL
taking False path
766         talloc_free(mem_ctx);
767         PyErr_NoMemory();
768         return NULL;
769     }
770 
771     /* Connect to the conf db */
772     ret = confdb_init(self->mem_ctx, &self->confdb, confdb_path);
773     if (ret != EOK) {
when considering range: -0x80000000 <= value <= -1
taking True path
774         talloc_free(mem_ctx);
775         PyErr_SetSssErrorWithMessage(ret,
776                 "Could not initialize connection to the confdb\n");
777         return NULL;
778     }
779 
780     ret = confdb_get_domain(self->confdb, "local", &self->local);
781     if (ret != EOK) {
782         talloc_free(mem_ctx);
783         PyErr_SetSssErrorWithMessage(ret, "Cannot get local domain");
784         return NULL;
785     }
786 
787     /* open 'local' sysdb at default path */
788     ret = sysdb_domain_init(self->mem_ctx, self->local, DB_PATH, &self->sysdb);
789     if (ret != EOK) {
790         talloc_free(mem_ctx);
791         PyErr_SetSssErrorWithMessage(ret,
792                 "Could not initialize connection to the sysdb\n");
793         return NULL;
794     }
795 
796     self->lock = DO_LOCK;
797     self->unlock = DO_UNLOCK;
798 
799     return (PyObject *) self;
800 }
returning (PyObject*)NULL without setting an exception
found 5 similar trace(s) to this