From 5bbe9101cfca7ee4bce1e6e2615e783908375817 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 25 Nov 2006 19:28:09 +0000 Subject: r19904: port fies from samba3 (This used to be commit 49d1559d3670de4a4f9eace99600c37cf039bae2) --- source4/lib/ldb/modules/asq.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c index 7d10a31b34..e95135145e 100644 --- a/source4/lib/ldb/modules/asq.c +++ b/source4/lib/ldb/modules/asq.c @@ -105,6 +105,9 @@ static int asq_terminate(struct ldb_handle *handle) int i; ac = talloc_get_type(handle->private_data, struct asq_context); + if (ac == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } handle->status = LDB_SUCCESS; handle->state = LDB_ASYNC_DONE; @@ -159,6 +162,9 @@ static int asq_base_callback(struct ldb_context *ldb, void *context, struct ldb_ } ac = talloc_get_type(context, struct asq_context); + if (ac == NULL) { + goto error; + } /* we are interested only in the single reply (base search) we receive here */ if (ares->type == LDB_REPLY_ENTRY) { @@ -183,6 +189,9 @@ static int asq_reqs_callback(struct ldb_context *ldb, void *context, struct ldb_ } ac = talloc_get_type(context, struct asq_context); + if (ac == NULL) { + goto error; + } /* we are interested only in the single reply (base search) we receive here */ if (ares->type == LDB_REPLY_ENTRY) { @@ -287,6 +296,9 @@ static int asq_requests(struct ldb_handle *handle) { int i; ac = talloc_get_type(handle->private_data, struct asq_context); + if (ac == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } /* look up the DNs */ if (ac->base_res == NULL) { @@ -349,7 +361,9 @@ static int asq_wait_none(struct ldb_handle *handle) handle->status = LDB_SUCCESS; ac = talloc_get_type(handle->private_data, struct asq_context); - + if (ac == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } switch (ac->step) { case ASQ_SEARCH_BASE: -- cgit