summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2015-01-29 08:10:36 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-01-29 11:58:43 +0100
commit3cd7275c3c41a03eb65769c2bf4e472d1de7b8c0 (patch)
treee4e03c555324ac5fb2ed9ccb60e74f3ddd377ed4 /src
parent33889b2ad764beb6b129f5211b1fab9790da8884 (diff)
downloadsssd-3cd7275c3c41a03eb65769c2bf4e472d1de7b8c0.tar.gz
sssd-3cd7275c3c41a03eb65769c2bf4e472d1de7b8c0.tar.xz
sssd-3cd7275c3c41a03eb65769c2bf4e472d1de7b8c0.zip
pysss: Fix double free
The talloc context is removed in destructor. ==1695== Invalid read of size 4 ==1695== at 0x1243D0CD: talloc_chunk_from_ptr (talloc.c:372) ==1695== by 0x1243D0CD: _talloc_free (talloc.c:1559) ==1695== by 0x117B18C3: PySssLocalObject_dealloc (pysss.c:836) ==1695== by 0x117B1AEE: PySssLocalObject_new (pysss.c:898) ==1695== by 0x4ED5522: type_call (typeobject.c:729) ==1695== by 0x4E7F902: PyObject_Call (abstract.c:2529) ==1695== by 0x4F15584: do_call (ceval.c:4328) ==1695== by 0x4F15584: call_function (ceval.c:4133) ==1695== by 0x4F15584: PyEval_EvalFrameEx (ceval.c:2753) ==1695== by 0x4F16BE5: fast_function (ceval.c:4196) ==1695== by 0x4F16BE5: call_function (ceval.c:4131) ==1695== by 0x4F16BE5: PyEval_EvalFrameEx (ceval.c:2753) ==1695== by 0x4F183FF: PyEval_EvalCodeEx (ceval.c:3342) ==1695== by 0x4EA46BC: function_call (funcobject.c:526) ==1695== by 0x4E7F902: PyObject_Call (abstract.c:2529) ==1695== by 0x4F1504F: ext_do_call (ceval.c:4423) ==1695== by 0x4F1504F: PyEval_EvalFrameEx (ceval.c:2792) ==1695== by 0x4F183FF: PyEval_EvalCodeEx (ceval.c:3342) ==1695== Address 0x112d4560 is 64 bytes inside a block of size 96 free'd ==1695== at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==1695== by 0x1243D2F2: _talloc_free_internal (talloc.c:1057) ==1695== by 0x1243D2F2: _talloc_free (talloc.c:1581) ==1695== by 0x117B1ABF: PySssLocalObject_new (pysss.c:876) ==1695== by 0x4ED5522: type_call (typeobject.c:729) ==1695== by 0x4E7F902: PyObject_Call (abstract.c:2529) ==1695== by 0x4F15584: do_call (ceval.c:4328) ==1695== by 0x4F15584: call_function (ceval.c:4133) ==1695== by 0x4F15584: PyEval_EvalFrameEx (ceval.c:2753) ==1695== by 0x4F16BE5: fast_function (ceval.c:4196) ==1695== by 0x4F16BE5: call_function (ceval.c:4131) ==1695== by 0x4F16BE5: PyEval_EvalFrameEx (ceval.c:2753) ==1695== by 0x4F183FF: PyEval_EvalCodeEx (ceval.c:3342) ==1695== by 0x4EA46BC: function_call (funcobject.c:526) ==1695== by 0x4E7F902: PyObject_Call (abstract.c:2529) ==1695== by 0x4F1504F: ext_do_call (ceval.c:4423) ==1695== by 0x4F1504F: PyEval_EvalFrameEx (ceval.c:2792) ==1695== by 0x4F183FF: PyEval_EvalCodeEx (ceval.c:3342) Reviewed-by: Pavel Reichl <preichl@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/python/pysss.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/python/pysss.c b/src/python/pysss.c
index 684ad72b1..50f804217 100644
--- a/src/python/pysss.c
+++ b/src/python/pysss.c
@@ -865,7 +865,6 @@ static PyObject *PySssLocalObject_new(PyTypeObject *type,
confdb_path = talloc_asprintf(self->mem_ctx, "%s/%s", DB_PATH, CONFDB_FILE);
if (confdb_path == NULL) {
- talloc_free(mem_ctx);
PyErr_NoMemory();
goto fail;
}
@@ -873,7 +872,6 @@ static PyObject *PySssLocalObject_new(PyTypeObject *type,
/* Connect to the conf db */
ret = confdb_init(self->mem_ctx, &self->confdb, confdb_path);
if (ret != EOK) {
- talloc_free(mem_ctx);
PyErr_SetSssErrorWithMessage(ret,
"Could not initialize connection to the confdb\n");
goto fail;
@@ -882,7 +880,6 @@ static PyObject *PySssLocalObject_new(PyTypeObject *type,
ret = sssd_domain_init(self->mem_ctx, self->confdb, "local",
DB_PATH, &self->local);
if (ret != EOK) {
- talloc_free(mem_ctx);
PyErr_SetSssErrorWithMessage(ret,
"Could not initialize connection to the sysdb\n");
goto fail;