]> git.sur5r.net Git - openldap/blobdiff - servers/ldapd/syntax.c
Fix memory leak if duplicate attr name in at_insert
[openldap] / servers / ldapd / syntax.c
index 955ce71734bd9df70ebea1148031d8772e80346e..005fb78d6bb2336e4c9f206ddde407e32433fb19 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright (c) 1990 Regents of the University of Michigan.
  * All rights reserved.
@@ -147,7 +148,7 @@ attr_key_rfc1779(
 
     if ( x == NULL ) {
         x = "?";
-    } else if ( isdigit ( *x ) ) {
+    } else if ( isdigit ( (unsigned char) *x ) ) {
         sprintf ( key, "OID.%s", x );
         return;
     } else if (strcasecmp(x,"commonName")==0) {
@@ -169,8 +170,8 @@ attr_key_rfc1779(
     strcpy ( key, x );
 }
 
-#define SEPARATOR(c)   (c == ',' || c == ';')
-#define SPACE(c)       (c == ' ' || c == '\n')
+#define SEPARATOR(c)   ((c) == ',' || (c) == ';')
+#define SPACE(c)       ((c) == ' ' || (c) == '\n')
 
 int
 dn_print_real(
@@ -439,7 +440,7 @@ put_photo_value( BerElement *ber, AttributeValue av )
                len = ps_get_abs( pe );
                Debug( LDAP_DEBUG_ARGS, "put_photo_val: ber_printf %d bytes\n",
                    len, 0, 0 );
-               if (( phber = der_alloc()) == NULLBER ) {
+               if (( phber = der_alloc()) == NULL ) {
                        Debug( LDAP_DEBUG_ANY, "der_alloc failed\n", 0, 0, 0 );
                        return( -1 );
                }
@@ -788,7 +789,8 @@ static void
 de_t61( char *s, int t61mark )
 {
        char    *next = s;
-       int     c, hex;
+       unsigned char   c;
+       unsigned int    hex;
 
        while ( *s ) {
                switch ( *s ) {