------------------------------------------------------------ revno: 12395 revision-id: squid3@treenet.co.nz-20121124020149-3ia438f85dn80l8m parent: squid3@treenet.co.nz-20121124020115-o6gr2gn7dz2bad0i committer: Amos Jeffries branch nick: 3.3 timestamp: Fri 2012-11-23 19:01:49 -0700 message: 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 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121124020149-3ia438f85dn80l8m # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 29ea2f644ab21b2215e93f2d88302e27e6a935a0 # timestamp: 2012-11-24 02:04:49 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20121124020115-\ # o6gr2gn7dz2bad0i # # Begin patch === modified file 'helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc' --- helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc 2012-07-02 15:31:03 +0000 +++ helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc 2012-11-24 02:01:49 +0000 @@ -1178,10 +1178,7 @@ 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 @@ 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;