]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
kerberos_ldap_group: fix LDAP string duplication
authorMarkus Moeller <huaraz@moeller.plus.com>
Fri, 1 Nov 2013 01:26:24 +0000 (19:26 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 1 Nov 2013 01:26:24 +0000 (19:26 -0600)
helpers/external_acl/kerberos_ldap_group/support_ldap.cc

index b9ebd25c4f7d9673ae657c947561abf8ffe87735..73e7ec582e9d0edb4d8f82e813c17a689b94e4b9 100644 (file)
@@ -640,11 +640,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;
@@ -707,9 +707,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;