diff options
Diffstat (limited to 'source3/libads/ldap_user.c')
-rw-r--r-- | source3/libads/ldap_user.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/libads/ldap_user.c b/source3/libads/ldap_user.c index bef2c91292..eecd9045e5 100644 --- a/source3/libads/ldap_user.c +++ b/source3/libads/ldap_user.c @@ -35,7 +35,10 @@ return ADS_ERROR(LDAP_NO_MEMORY); } - asprintf(&ldap_exp, "(samAccountName=%s)", escaped_user); + if (asprintf(&ldap_exp, "(samAccountName=%s)", escaped_user) == -1) { + SAFE_FREE(escaped_user); + return ADS_ERROR(LDAP_NO_MEMORY); + } status = ads_search(ads, res, ldap_exp, attrs); SAFE_FREE(ldap_exp); SAFE_FREE(escaped_user); |