]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/entry.c
Use IPV6_V6ONLY on IPv6 sockets if available. This way we only get IPv6
[openldap] / servers / slapd / entry.c
index 48afbf5d9d3e99724999f9246196f253e7e1af56..f5829d395af02a3555138d88234b8df301b6e68e 100644 (file)
@@ -109,8 +109,6 @@ str2entry( char *s )
                }
 
                if ( strcasecmp( type, "dn" ) == 0 ) {
-                       struct berval *pdn = NULL;
-
                        free( type );
 
                        if ( e->e_dn != NULL ) {
@@ -131,22 +129,21 @@ str2entry( char *s )
                        }
 
                        rc = dnPrettyNormal( NULL, &vals[0], &e->e_name, &e->e_nname );
-                       free( vals[0].bv_val );
                        if( rc != LDAP_SUCCESS ) {
 #ifdef NEW_LOGGING
                                LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
                                        "entry %ld has invalid DN \"%s\"\n",
-                                       (long) e->e_id,
-                                       pdn->bv_val ? pdn->bv_val : "" ));
+                                       (long) e->e_id, vals[0].bv_val ));
 #else
                                Debug( LDAP_DEBUG_ANY, "str2entry: "
                                        "entry %ld has invalid DN \"%s\"\n",
-                                       (long) e->e_id,
-                                       pdn->bv_val ? pdn->bv_val : "", 0 );
+                                       (long) e->e_id, vals[0].bv_val, 0 );
 #endif
                                entry_free( e );
+                               free( vals[0].bv_val );
                                return NULL;
                        }
+                       free( vals[0].bv_val );
                        continue;
                }
 
@@ -308,6 +305,8 @@ entry2str(
        int             i;
        ber_len_t tmplen;
 
+       assert( e != NULL );
+
        /*
         * In string format, an entry looks like this:
         *      dn: <dn>\n