s3:pylibsmb: Initialize pointers to NULL in new API code
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 16 Jan 2019 21:52:24 +0000 (10:52 +1300)
committerJeremy Allison <jra@samba.org>
Fri, 25 Jan 2019 23:53:10 +0000 (00:53 +0100)
Fix a few uninitialized pointers that managed to sneak through review.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index b4903a9b8c54f2d726ce925f9a4b7cf9a2261325..629ff0a4fd373a9e1215ba563e5da4a26f662886 100644 (file)
@@ -1223,7 +1223,7 @@ static PyObject *py_cli_list(struct py_cli_state *self,
        char *user_mask = NULL;
        unsigned int attribute = LIST_ATTRIBUTE_MASK;
        NTSTATUS status;
-       PyObject *result;
+       PyObject *result = NULL;
        const char *kwlist[] = { "directory", "mask", "attribs", NULL };
 
        if (!ParseTupleAndKeywords(args, kwds, "z|sH:list", kwlist,
@@ -1313,7 +1313,7 @@ static NTSTATUS remove_dir(struct py_cli_state *self, const char *dirname)
 static PyObject *py_smb_rmdir(struct py_cli_state *self, PyObject *args)
 {
        NTSTATUS status;
-       const char *dirname;
+       const char *dirname = NULL;
 
        if (!PyArg_ParseTuple(args, "s:rmdir", &dirname)) {
                return NULL;
@@ -1331,7 +1331,7 @@ static PyObject *py_smb_rmdir(struct py_cli_state *self, PyObject *args)
 static PyObject *py_smb_mkdir(struct py_cli_state *self, PyObject *args)
 {
        NTSTATUS status;
-       const char *dirname;
+       const char *dirname = NULL;
 
        if (!PyArg_ParseTuple(args, "s:mkdir", &dirname)) {
                return NULL;
@@ -1379,7 +1379,7 @@ static bool check_dir_path(struct py_cli_state *self, const char *path)
 
 static PyObject *py_smb_chkpath(struct py_cli_state *self, PyObject *args)
 {
-       const char *path;
+       const char *path = NULL;
        bool dir_exists;
 
        if (!PyArg_ParseTuple(args, "s:chkpath", &path)) {