]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_edirectory_userip_acl: Polish: Remove dead code
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 14 Nov 2012 05:34:55 +0000 (22:34 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 14 Nov 2012 05:34:55 +0000 (22:34 -0700)
* 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

helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc

index db774ef9e95b2674c29585cefe878fd5e608ea4a..8751c0806dc1756df396c67d73a66339e613fd7f 100644 (file)
@@ -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;