Debug( LDAP_DEBUG_ANY,
"Error: Re_parse: bad type <%s>\n",
type, 0, 0 );
+ free( type );
+ if ( value != NULL )
+ free( value );
return -1;
}
}
+ free( type );
+ if ( value != NULL )
+ free( value );
}
if ( state != GOT_ALL ) {
}
for (;;) {
+ char *const dash = "-";
+
if (( buf = ldif_getline( &rp )) == NULL ) {
break;
}
buflen = strlen( buf );
if (( buflen == 1 ) && ( buf[ 0 ] == '-' )) {
- type = "-";
+ type = dash;
value = NULL;
} else {
if ( ldif_parse_line( buf, &type, &value, &len ) < 0 ) {
re->re_mods[ nml + 1 ].mi_type = NULL;
re->re_mods[ nml + 1 ].mi_val = NULL;
nml++;
+
+ if ( type != dash )
+ free( type );
+ if ( value != NULL )
+ free( value );
}
return 0;
}
break;
}
}
+ free( type );
if ( !repl_ok ) {
warn_unknown_replica( value, port );
+ if ( value != NULL )
+ free( value );
continue;
}
rh[ nreplicas ].rh_hostname = strdup( value );
rh[ nreplicas ].rh_port = port;
nreplicas++;
+
+ if ( value != NULL )
+ free( value );
}
if ( nreplicas == 0 ) {