Set trans to a value that is not LDB_SUCCESS (all LDB_ constants are
authorMichele Baldessari <michele@acksyn.org>
Mon, 10 Sep 2012 21:58:28 +0000 (14:58 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 10 Sep 2012 21:58:28 +0000 (14:58 -0700)
positive) so that any "goto failed:" call does not end up calling
ldb_transaction_cancel() if trans is initialized to 0 (LDB_SUCCESS)
by chance.

Signed-off-by: Jeremy Allison <jra@samba.org>
source4/winbind/idmap.c

index 976a2d0f9d3fb0c3b1ea29c881de6fbec6c8d3cf..a6cc88f827825f35be6238517d2cb6a72cfcfb93 100644 (file)
@@ -387,7 +387,7 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
        struct ldb_dn *dn;
        struct ldb_message *hwm_msg, *map_msg, *sam_msg;
        struct ldb_result *res = NULL;
-       int trans;
+       int trans = -1;
        uint32_t low, high, hwm, new_xid;
        char *sid_string, *unixid_string, *hwm_string;
        bool hwm_entry_exists;