diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-18 13:18:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:27 -0500 |
commit | bf75ae41556a67739cd089a7e3182cf2a994448c (patch) | |
tree | 7782f538f0d6c83ccb037add1d907d4a0de2f5df /source4/lib/ldb/ldb_ildap/ldb_ildap.c | |
parent | e2bb0d0ba75265101cefd7325d705a7bf63ec585 (diff) | |
download | samba-bf75ae41556a67739cd089a7e3182cf2a994448c.tar.gz samba-bf75ae41556a67739cd089a7e3182cf2a994448c.tar.bz2 samba-bf75ae41556a67739cd089a7e3182cf2a994448c.zip |
r7726: - removed some unused variables
- handle ldb_errstring() calls on failed connect
(This used to be commit 8698a20fcc6a04ccbe533afd742e7a5df94423ee)
Diffstat (limited to 'source4/lib/ldb/ldb_ildap/ldb_ildap.c')
-rw-r--r-- | source4/lib/ldb/ldb_ildap/ldb_ildap.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index 3f63af482f..6560485be5 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -340,7 +340,11 @@ static int ildb_unlock(struct ldb_module *module, const char *lockname) */ static const char *ildb_errstring(struct ldb_module *module) { - struct ildb_private *ildb = module->private_data; + struct ildb_private *ildb = talloc_get_type(module->private_data, + struct ildb_private); + if (ildb == NULL) { + return "ildap not connected"; + } return ldap_errstr(ildb->ldap, ildb->last_rc); } @@ -427,6 +431,9 @@ int ildb_connect(struct ldb_context *ldb, const char *url, return 0; failed: + if (ldb->modules) { + ldb->modules->private_data = NULL; + } talloc_free(ildb); return -1; } |