r15788: Do not crash when no result is returned
authorSimo Sorce <idra@samba.org>
Sun, 21 May 2006 23:57:19 +0000 (23:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:08:20 +0000 (14:08 -0500)
(This used to be commit efb7e39e512eb71deaeef1315bc88a902e5cd848)

source4/torture/ldap/cldap.c

index 78bc6063a56b02047d8c667e1675746a99073ddd..45d758547d20a1e4a4d27fd62664c3a56fa99751 100644 (file)
@@ -186,6 +186,10 @@ static void cldap_dump_results(struct cldap_search *search)
        struct ldb_ldif ldif;
        struct ldb_context *ldb;
 
+       if (!search || !(search->out.response)) {
+               return;
+       }
+
        /* we need a ldb context to use ldb_ldif_write_file() */
        ldb = ldb_init(NULL);