ldb: silence some clang warnings in picky developer mode
authorUri Simchoni <uri@samba.org>
Sun, 19 Nov 2017 07:19:03 +0000 (07:19 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 Nov 2017 09:20:20 +0000 (10:20 +0100)
Avoid const in casting since it doesn't increase code
safety in this case and causes clang to generate const-qual
warning. Also initialize a pointer to NULL to silence clang
uninitialized variable warning.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c

index 515a69e698169162d8f14bb21f632f1a896e4ff3..e61b5b6a4f48927717311cc66fb1fe392ff8beba 100644 (file)
@@ -510,10 +510,10 @@ static PyObject *py_ldb_dn_set_extended_component(PyLdbDnObject *self, PyObject
 {
        char *name;
        int err;
-       uint8_t *value;
+       uint8_t *value = NULL;
        Py_ssize_t size = 0;
 
-       if (!PyArg_ParseTuple(args, "sz#", &name, (const char**)&value, &size))
+       if (!PyArg_ParseTuple(args, "sz#", &name, (char **)&value, &size))
                return NULL;
 
        if (value == NULL) {