]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/lib/py-registry: initialize optional parameters for open_* functions
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 12 Apr 2018 05:15:19 +0000 (17:15 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:14 +0000 (07:27 +0200)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source4/lib/registry/pyregistry.c

index f36973feb35d438d67401babc6d907b350fa08ce..5d7f7f212b88cc87a410c2c7fc0279599c897331 100644 (file)
@@ -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;