From 3940777a14a93dbf88fcc9e43452fc2f84a7b6fc Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 21 Mar 2011 10:32:24 +0100 Subject: s4:python bindings - handle NULL returns from "loadparm_init_global" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Jelmer Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Tue Mar 22 19:52:57 CET 2011 on sn-devel-104 --- source4/auth/gensec/pygensec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/auth/gensec/pygensec.c') diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c index cd05bd7ccf..5fe3703138 100644 --- a/source4/auth/gensec/pygensec.c +++ b/source4/auth/gensec/pygensec.c @@ -113,6 +113,11 @@ static PyObject *py_gensec_start_client(PyTypeObject *type, PyObject *args, PyOb } settings->lp_ctx = loadparm_init_global(true); + if (settings->lp_ctx == NULL) { + PyErr_NoMemory(); + PyObject_DEL(self); + return NULL; + } } ev = tevent_context_init(self->talloc_ctx); @@ -181,6 +186,11 @@ static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyOb } settings->lp_ctx = loadparm_init_global(true); + if (settings->lp_ctx == NULL) { + PyErr_NoMemory(); + PyObject_DEL(self); + return NULL; + } } ev = tevent_context_init(self->talloc_ctx); -- cgit