summaryrefslogtreecommitdiff
path: root/source3/libads/ldap_printer.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-03-21 10:46:53 +0100
committerVolker Lendecke <vl@samba.org>2011-03-21 15:40:10 +0100
commit8dc93bed09961ada9a25e8144cb761d1d7bd1ac5 (patch)
tree1f34dd394eb381c1673a7d23df903ee91912df1e /source3/libads/ldap_printer.c
parent60280babeb54d0fc46bab0ebdae90f34e4a17395 (diff)
downloadsamba-8dc93bed09961ada9a25e8144cb761d1d7bd1ac5.tar.gz
samba-8dc93bed09961ada9a25e8144cb761d1d7bd1ac5.tar.bz2
samba-8dc93bed09961ada9a25e8144cb761d1d7bd1ac5.zip
s3: Fix Coverity ID 770, REVERSE_INULL
We dereference "res" in various places, no point in checking. All current callers send "res!=NULL".
Diffstat (limited to 'source3/libads/ldap_printer.c')
-rw-r--r--source3/libads/ldap_printer.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index e4bfbcead7..251dfb0a81 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -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);