mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
s3: Fix Coverity ID 770, REVERSE_INULL
We dereference "res" in various places, no point in checking. All current callers send "res!=NULL".
This commit is contained in:
parent
60280babeb
commit
8dc93bed09
@ -47,33 +47,25 @@
|
||||
return status;
|
||||
}
|
||||
if (ads_count_replies(ads, *res) != 1) {
|
||||
if (res) {
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
}
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
return ADS_ERROR(LDAP_NO_SUCH_OBJECT);
|
||||
}
|
||||
srv_dn = ldap_get_dn(ads->ldap.ld, *res);
|
||||
if (srv_dn == NULL) {
|
||||
if (res) {
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
}
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
}
|
||||
srv_cn = ldap_explode_dn(srv_dn, 1);
|
||||
if (srv_cn == NULL) {
|
||||
ldap_memfree(srv_dn);
|
||||
if (res) {
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
}
|
||||
return ADS_ERROR(LDAP_INVALID_DN_SYNTAX);
|
||||
}
|
||||
if (res) {
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
return ADS_ERROR(LDAP_INVALID_DN_SYNTAX);
|
||||
}
|
||||
ads_msgfree(ads, *res);
|
||||
*res = NULL;
|
||||
|
||||
if (asprintf(&s, "(cn=%s-%s)", srv_cn[0], printer) == -1) {
|
||||
ldap_memfree(srv_dn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user