From 8dc93bed09961ada9a25e8144cb761d1d7bd1ac5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Mar 2011 10:46:53 +0100 Subject: s3: Fix Coverity ID 770, REVERSE_INULL We dereference "res" in various places, no point in checking. All current callers send "res!=NULL". --- source3/libads/ldap_printer.c | 22 +++++++--------------- 1 file 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); -- cgit