Fix a warning about a set but unused variable by actually using it
authorMatthieu Patou <mat@matws.net>
Fri, 17 May 2013 12:22:33 +0000 (05:22 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 20 May 2013 11:54:06 +0000 (21:54 +1000)
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c

index 97016b5f62614a0046ad1362c38f398aca0bd772..451c7a1c666d95ec613cc14905c5d40b86032ec4 100644 (file)
@@ -841,6 +841,11 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque
        seq = talloc_get_type(req->op.extended.data, struct ldb_seqnum_request);
 
        map_private = talloc_get_type(ldb_module_get_private(module), struct map_private);
+       if (!map_private) {
+               ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+                             "private data is not of type struct map_private");
+               return LDB_ERR_PROTOCOL_ERROR;
+       }
 
        /* All this to get the DN of the parition, so we can search the right thing */
        partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);