]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix rev.13668 strdup uses and removes the safe_free
authorMarkus Moeller <huaraz@moeller.plus.com>
Mon, 3 Nov 2014 03:42:31 +0000 (19:42 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 3 Nov 2014 03:42:31 +0000 (19:42 -0800)
* use xstrdup() instead of strdup()

* replace safe_free() which should be just a setting to NULL.

helpers/external_acl/kerberos_ldap_group/support_krb5.cc
helpers/external_acl/kerberos_ldap_group/support_ldap.cc

index eb0bac05b52bfee30e7a32205f32c60d77bb47a7..240cbd00c6fd02df467433842cf2458185d55245 100644 (file)
@@ -99,7 +99,7 @@ krb5_create_cache(char *domain)
         }
     }
     if ( ccindex == -1 ) {
-        kparam.mem_ccache[kparam.ncache]=strdup(mem_cache);
+        kparam.mem_ccache[kparam.ncache]=xstrdup(mem_cache);
         ccindex=kparam.ncache;
         kparam.ncache++;
         if ( kparam.ncache == MAX_DOMAINS ) {
@@ -155,7 +155,7 @@ krb5_create_cache(char *domain)
                     }
                     if (creds)
                         krb5_free_creds(kparam.context, creds);
-                    safe_free(creds);
+                    creds = NULL;
                     safe_free(principal_name);
                     debug((char *) "%s| %s: DEBUG: Reset credential cache to %s\n", LogTime(), PROGRAM, mem_cache);
                     code = krb5_cc_resolve(kparam.context, mem_cache, &kparam.cc[ccindex]);
index 7c37ba89b08f3fa125260f41d09cb8e8d5421e89..3afe03cbcd2c615aa2543fea2760f9823fee5eac 100644 (file)
@@ -1239,11 +1239,11 @@ get_memberof(struct main_args *margs, char *user, char *domain, char *group)
                         snprintf(search_exp, se_len, "%s", FILTER_SID_1 );
 
                         for (int j=0; j<len; j++) {
-                            se=strdup(search_exp);
+                            se=xstrdup(search_exp);
                             snprintf(search_exp, se_len, "%s\\%02x", se, attr_value_3[0][j] & 0xFF);
                             xfree(se);
                         }
-                        se=strdup(search_exp);
+                        se=xstrdup(search_exp);
                         snprintf(search_exp, se_len, "%s%s", se, FILTER_SID_2 );
                         xfree(se);