diff options
Diffstat (limited to 'source3/libads/sasl.c')
-rw-r--r-- | source3/libads/sasl.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c index a04ac9dd69..438db05df8 100644 --- a/source3/libads/sasl.c +++ b/source3/libads/sasl.c @@ -652,7 +652,12 @@ static ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads, return ADS_ERROR(LDAP_NO_MEMORY); } - strlower_m(server); + if (!strlower_m(server)) { + SAFE_FREE(server); + SAFE_FREE(server_realm); + return ADS_ERROR(LDAP_NO_MEMORY); + } + if (!strupper_m(server_realm)) { SAFE_FREE(server); SAFE_FREE(server_realm); @@ -683,7 +688,12 @@ static ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads, return ADS_ERROR(LDAP_NO_MEMORY); } - strlower_m(server); + if (!strlower_m(server)) { + SAFE_FREE(server); + SAFE_FREE(server_realm); + return ADS_ERROR(LDAP_NO_MEMORY); + } + if (!strupper_m(server_realm)) { SAFE_FREE(server); SAFE_FREE(server_realm); |