From 15bd82550dab7a4709e92d639ee563dbc4780366 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 18 Aug 2013 19:49:24 +0000 Subject: ldb: Fix CID 1034793 Dereference null return value Add a proper NULL check Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- lib/ldb/tools/ldbtest.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/ldb') diff --git a/lib/ldb/tools/ldbtest.c b/lib/ldb/tools/ldbtest.c index 4e181af9d5..384624ca55 100644 --- a/lib/ldb/tools/ldbtest.c +++ b/lib/ldb/tools/ldbtest.c @@ -324,6 +324,10 @@ static void start_test_index(struct ldb_context **ldb) ldb_delete(*ldb, indexlist); msg = ldb_msg_new(NULL); + if (msg == NULL) { + printf("ldb_msg_new failed\n"); + exit(LDB_ERR_OPERATIONS_ERROR); + } msg->dn = indexlist; ldb_msg_add_string(msg, "@IDXATTR", strdup("uid")); -- cgit