From: Amos Jeffries Date: Sat, 24 Nov 2012 02:01:49 +0000 (-0700) Subject: ext_edirectory_userip_acl: Polish: Remove dead code X-Git-Tag: SQUID_3_3_0_2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b6975d06da89c6eedcdd1f37e81b6cb8ec4befd;p=thirdparty%2Fsquid.git ext_edirectory_userip_acl: Polish: Remove dead code * filter variable being NULL results in error condition returned before the filter is used. No need to test and use a hard-coded backup filter. * ber variable is freed in the master loop and is not skipped. The loop only exists when ent is NULL. Neither needs to be freed. Detected by Coverity Scan. Issues 740339, 740340, 740341 --- diff --git a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc index db774ef9e9..8751c0806d 100644 --- a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc +++ b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc @@ -1178,10 +1178,7 @@ SearchLDAP(edui_ldap_t *l, int scope, char *filter, char **attrs) if (l->lm != NULL) ldap_msgfree(l->lm); /* Make sure l->lm is empty */ - if (filter == NULL) /* if filter is NULL, then return ALL networkAddress */ - xstrncpy(ft, "(&(objectClass=User)(networkAddress=*))", sizeof(ft)); - else - xstrncpy(ft, filter, sizeof(ft)); + xstrncpy(ft, filter, sizeof(ft)); /* We have a binded connection, with a free l->lm, so let's get this done */ switch (scope) { @@ -1408,14 +1405,6 @@ SearchIPLDAP(edui_ldap_t *l) ldap_value_free_len(l->val); l->val = NULL; } - if (ber != NULL) { - ldap_value_free_len(ber); - ber = NULL; - } - if (ent != NULL) { - ldap_msgfree(ent); - ent = NULL; - } if (l->lm != NULL) { ldap_msgfree(l->lm); l->lm = NULL;