ldb: Fix CID 1034793 Dereference null return value
authorVolker Lendecke <vl@samba.org>
Sun, 18 Aug 2013 19:49:24 +0000 (19:49 +0000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 15 Jul 2014 10:46:13 +0000 (12:46 +0200)
Add a proper NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 15bd82550dab7a4709e92d639ee563dbc4780366)

lib/ldb/tools/ldbtest.c

index 4e181af9d55f03c623896ca25fc67662e645968b..384624ca5530fa2ba3324ee731f06bef20ea00c5 100644 (file)
@@ -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"));