s3: Fix Coverity ID 2336, NULL_RETURNS
authorVolker Lendecke <vl@samba.org>
Fri, 22 Apr 2011 07:48:10 +0000 (09:48 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 22 Apr 2011 08:06:36 +0000 (10:06 +0200)
source3/libads/ldap.c

index 3ce7a7e869a185a53bef7742b22a5af98259f9c7..90c645c44ad6546006d04ffc59e623baa7878352 100644 (file)
@@ -3502,6 +3502,10 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname)
        }
 
        hostnameDN = ads_get_dn(ads, talloc_tos(), (LDAPMessage *)msg);
+       if (hostnameDN == NULL) {
+               SAFE_FREE(host);
+               return ADS_ERROR_SYSTEM(ENOENT);
+       }
 
        rc = ldap_delete_ext_s(ads->ldap.ld, hostnameDN, pldap_control, NULL);
        if (rc) {