diff options
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/pyparam.c | 4 | ||||
-rw-r--r-- | source4/param/pyparam_util.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index a248215fd9..3ba8146860 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -335,6 +335,10 @@ static PyObject *py_lp_ctx_new(PyTypeObject *type, PyObject *args, PyObject *kwa return NULL; } ret->ptr = loadparm_init_global(false); + if (ret->ptr == NULL) { + PyErr_NoMemory(); + return NULL; + } return (PyObject *)ret; } diff --git a/source4/param/pyparam_util.c b/source4/param/pyparam_util.c index 528c007624..cbf2095e85 100644 --- a/source4/param/pyparam_util.c +++ b/source4/param/pyparam_util.c @@ -35,6 +35,9 @@ _PUBLIC_ struct loadparm_context *lpcfg_from_py_object(TALLOC_CTX *mem_ctx, PyOb if (PyString_Check(py_obj)) { lp_ctx = loadparm_init_global(false); + if (lp_ctx == NULL) { + return NULL; + } if (!lpcfg_load(lp_ctx, PyString_AsString(py_obj))) { PyErr_Format(PyExc_RuntimeError, "Unable to load %s", PyString_AsString(py_obj)); |