]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
kerberos_ldap_group: fix LDAP string duplication
authorMarkus Moeller <huaraz@moeller.plus.com>
Sun, 3 Nov 2013 08:40:47 +0000 (01:40 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 Nov 2013 08:40:47 +0000 (01:40 -0700)
helpers/external_acl/kerberos_ldap_group/support_ldap.cc

index 3069fe2911716ded988e286ebd3a6dafd3c9cdec..18b985fb27f03c2c2377477b915a80ed4a6e9a5f 100644 (file)
@@ -643,11 +643,11 @@ tool_ldap_open(struct main_args * margs, char *host, int port, char *ssl)
     memset(url, 0, sizeof(*url));
 #ifdef HAVE_LDAP_URL_LUD_SCHEME
     if (ssl)
-        url->lud_scheme = (char *) "ldaps";
+        url->lud_scheme = xstrdup("ldaps");
     else
-        url->lud_scheme = (char *) "ldap";
+        url->lud_scheme = xstrdup("ldap");
 #endif
-    url->lud_host = host;
+    url->lud_host = xstrdup(host);
     url->lud_port = port;
 #ifdef HAVE_LDAP_SCOPE_DEFAULT
     url->lud_scope = LDAP_SCOPE_DEFAULT;
@@ -710,9 +710,9 @@ tool_ldap_open(struct main_args * margs, char *host, int port, char *ssl)
             url = (LDAPURLDesc *) xmalloc(sizeof(*url));
             memset(url, 0, sizeof(*url));
 #ifdef HAVE_LDAP_URL_LUD_SCHEME
-            url->lud_scheme = (char *) "ldaps";
+            url->lud_scheme = xstrdup("ldaps");
 #endif
-            url->lud_host = host;
+            url->lud_host = xstrdup(host);
             url->lud_port = port;
 #ifdef HAVE_LDAP_SCOPE_DEFAULT
             url->lud_scope = LDAP_SCOPE_DEFAULT;