svn commit: samba r19942 - in branches/SAMBA_3_0/source/lib/ldb/ldb_tdb: .

vlendec at samba.org vlendec at samba.org
Wed Nov 29 06:09:24 GMT 2006


Author: vlendec
Date: 2006-11-29 06:09:24 +0000 (Wed, 29 Nov 2006)
New Revision: 19942

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19942

Log:
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

Modified:
   branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c
===================================================================
--- branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c	2006-11-28 22:55:32 UTC (rev 19941)
+++ branches/SAMBA_3_0/source/lib/ldb/ldb_tdb/ldb_index.c	2006-11-29 06:09:24 UTC (rev 19942)
@@ -721,12 +721,15 @@
 */
 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;
 	}
 



More information about the samba-cvs mailing list