From 1c2ed583026631b94fc61a63e609eca2ad099bc1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 29 Nov 2006 06:09:24 +0000 Subject: r19942: Fix Coverity id 333, a dereference before a NULL check. Metze, you wanted to port talloc_get_type_abort() to 4. Should I just use it in 3-ldb? Volker (This used to be commit ba0df1c915c49afad629df789375440225968633) --- source3/lib/ldb/ldb_tdb/ldb_index.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source3/lib/ldb/ldb_tdb/ldb_index.c b/source3/lib/ldb/ldb_tdb/ldb_index.c index d7a8e5e9b5..2c88d7e19d 100644 --- a/source3/lib/ldb/ldb_tdb/ldb_index.c +++ b/source3/lib/ldb/ldb_tdb/ldb_index.c @@ -721,12 +721,15 @@ static int ltdb_index_filter(const struct dn_list *dn_list, */ int ltdb_search_indexed(struct ldb_handle *handle) { - struct ltdb_context *ac = talloc_get_type(handle->private_data, struct ltdb_context); - struct ltdb_private *ltdb = talloc_get_type(ac->module->private_data, struct ltdb_private); + struct ltdb_context *ac; + struct ltdb_private *ltdb; struct dn_list *dn_list; int ret; - if ((ac == NULL) || (ltdb == NULL)) { + if (!(ac = talloc_get_type(handle->private_data, + struct ltdb_context)) || + !(ltdb = talloc_get_type(ac->module->private_data, + struct ltdb_private))) { return -1; } -- cgit