summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules/asq.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-25 19:28:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:34 -0500
commit5bbe9101cfca7ee4bce1e6e2615e783908375817 (patch)
treef85e3b5b3bff1f1e746f873b5d2f8686142cd8c6 /source4/lib/ldb/modules/asq.c
parent9ae017588c23a8330e7b213856930dcb18123077 (diff)
downloadsamba-5bbe9101cfca7ee4bce1e6e2615e783908375817.tar.gz
samba-5bbe9101cfca7ee4bce1e6e2615e783908375817.tar.bz2
samba-5bbe9101cfca7ee4bce1e6e2615e783908375817.zip
r19904: port fies from samba3
(This used to be commit 49d1559d3670de4a4f9eace99600c37cf039bae2)
Diffstat (limited to 'source4/lib/ldb/modules/asq.c')
-rw-r--r--source4/lib/ldb/modules/asq.c16
1 files changed, 15 insertions, 1 deletions
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: