point to a NULL pointer, that is assert( *out == NULL ).
Eventually, we'll allow **out to point to a preallocated
struct berval (to avoid unnecessary allocation).
if( a->acl_dn_pat.bv_len != 0 ) {
if ( a->acl_dn_style != ACL_STYLE_REGEX )
{
- struct berval *bv;
+ struct berval *bv = NULL;
dnNormalize( NULL, &a->acl_dn_pat, &bv);
free( a->acl_dn_pat.bv_val );
a->acl_dn_pat = *bv;
e->e_private = NULL;
{
- struct berval *pdn;
+ struct berval *pdn = NULL;
rc = dnPretty( NULL, &dn, &pdn );
if( rc != LDAP_SUCCESS ) {
}
{
- struct berval *ndn;
+ struct berval *ndn = NULL;
rc = dnNormalize( NULL, &dn, &ndn );
if( rc != LDAP_SUCCESS ) {
assert( val );
assert( normalized );
+ assert( *normalized == NULL );
+
if ( val->bv_len != 0 ) {
LDAPDN *dn = NULL;
char *dn_out = NULL;
assert( val );
assert( pretty );
+ assert( *pretty == NULL );
if ( val->bv_len != 0 ) {
LDAPDN *dn = NULL;
char *
dn_validate( char *dn )
{
- struct berval val, *pretty;
+ struct berval val;
+ struct berval *pretty = NULL;
int rc;
if ( dn == NULL || dn[0] == '\0' ) {
char *
dn_normalize( char *dn )
{
- struct berval val, *normalized;
+ struct berval val;
+ struct berval *normalized = NULL;
int rc;
if ( dn == NULL || dn[0] == '\0' ) {
}
if ( strcasecmp( type, "dn" ) == 0 ) {
- struct berval *pdn;
+ struct berval *pdn = NULL;
free( type );
return NULL;
}
- e->e_name.bv_val = pdn->bv_val != NULL ? pdn->bv_val : ch_strdup( "" );
+ e->e_name.bv_val = pdn->bv_val != NULL
+ ? pdn->bv_val : ch_strdup( "" );
e->e_name.bv_len = pdn->bv_len;
free( pdn );
continue;
/* generate normalized dn */
{
- struct berval *ndn;
+ struct berval *ndn = NULL;
rc = dnNormalize( NULL, &e->e_name, &ndn );
-
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,