From: Douglas Bagnall Date: Thu, 12 Apr 2018 05:15:19 +0000 (+1200) Subject: s4/lib/py-registry: initialize optional parameters for open_* functions X-Git-Tag: ldb-1.4.0~578 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30fb803ec07eb865c4c31c54320cef08e1cafff0;p=thirdparty%2Fsamba.git s4/lib/py-registry: initialize optional parameters for open_* functions Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Alexander Bokovoy --- diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c index f36973feb35..5d7f7f212b8 100644 --- a/source4/lib/registry/pyregistry.c +++ b/source4/lib/registry/pyregistry.c @@ -250,7 +250,9 @@ static PyObject *py_open_hive(PyTypeObject *type, PyObject *args, PyObject *kwar const char *kwnames[] = { "location", "lp_ctx", "session_info", "credentials", NULL }; WERROR result; struct loadparm_context *lp_ctx; - PyObject *py_lp_ctx, *py_session_info, *py_credentials; + PyObject *py_lp_ctx = Py_None; + PyObject *py_session_info = Py_None; + PyObject *py_credentials = Py_None; struct auth_session_info *session_info; struct cli_credentials *credentials; char *location; @@ -312,7 +314,9 @@ static PyObject *py_open_samba(PyObject *self, PyObject *args, PyObject *kwargs) struct registry_context *reg_ctx; WERROR result; struct loadparm_context *lp_ctx; - PyObject *py_lp_ctx, *py_session_info, *py_credentials; + PyObject *py_lp_ctx = Py_None; + PyObject *py_session_info = Py_None; + PyObject *py_credentials = Py_None; struct auth_session_info *session_info; struct cli_credentials *credentials; TALLOC_CTX *mem_ctx;