httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental util_ldap.c
Date Mon, 26 Apr 2004 19:46:14 GMT
bnicholes    2004/04/26 12:46:14

  Modified:    modules/experimental util_ldap.c
  Log:
  Allow the memory address to change
  
  Revision  Changes    Path
  1.25      +12 -12    httpd-2.0/modules/experimental/util_ldap.c
  
  Index: util_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/util_ldap.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- util_ldap.c	14 Apr 2004 14:41:28 -0000	1.24
  +++ util_ldap.c	26 Apr 2004 19:46:14 -0000	1.25
  @@ -89,16 +89,16 @@
   #endif
   
   
  -static void util_ldap_strdup (char *str, const char *newstr)
  +static void util_ldap_strdup (char **str, const char *newstr)
   {
  -    if (str) {
  -        free(str);
  -        str = NULL;
  +    if (*str) {
  +        free(*str);
  +        *str = NULL;
       }
   
       if (newstr) {
  -        str = calloc(1, strlen(newstr)+1);
  -        strcpy (str, newstr);
  +        *str = calloc(1, strlen(newstr)+1);
  +        strcpy (*str, newstr);
       }
   }
   
  @@ -415,8 +415,8 @@
   
                   /* the bind credentials have changed */
                   l->bound = 0;
  -                util_ldap_strdup((char*)l->binddn, binddn);
  -                util_ldap_strdup((char*)l->bindpw, bindpw);
  +                util_ldap_strdup((char**)&(l->binddn), binddn);
  +                util_ldap_strdup((char**)&(l->bindpw), bindpw);
                   break;
               }
   #if APR_HAS_THREADS
  @@ -454,8 +454,8 @@
           l->host = apr_pstrdup(st->pool, host);
           l->port = port;
           l->deref = deref;
  -        util_ldap_strdup((char*)l->binddn, binddn);
  -        util_ldap_strdup((char*)l->bindpw, bindpw);
  +        util_ldap_strdup((char**)&(l->binddn), binddn);
  +        util_ldap_strdup((char**)&(l->bindpw), bindpw);
           l->secure = secure;
   
           /* add the cleanup to the pool */
  @@ -886,8 +886,8 @@
            * it is bound to the original user id specified ldc->binddn when in fact it
is 
            * bound to a completely different user id.
            */
  -        util_ldap_strdup((char*)ldc->binddn, *binddn);
  -        util_ldap_strdup((char*)ldc->bindpw, bindpw);
  +        util_ldap_strdup((char**)&(ldc->binddn), *binddn);
  +        util_ldap_strdup((char**)&(ldc->bindpw), bindpw);
       }
   
       /*
  
  
  

Mime
View raw message