summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index e925750e0a..48401cc3d8 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -709,7 +709,16 @@ char *ads_get_dn(ADS_STRUCT *ads, void *msg)
utf8_dn = ldap_get_dn(ads->ld, msg);
- pull_utf8_allocate((void **) &unix_dn, utf8_dn);
+ if (!utf8_dn) {
+ DEBUG (5, ("ads_get_dn: ldap_get_dn failed\n"));
+ return NULL;
+ }
+
+ if (pull_utf8_allocate((void **) &unix_dn, utf8_dn) == (size_t)-1) {
+ DEBUG(0,("ads_get_dn: string conversion failure utf8 [%s]\n",
+ utf8_dn ));
+ return NULL;
+ }
ldap_memfree(utf8_dn);
return unix_dn;
}