static int load_ucdata(char *path);
int
-read_config( const char *fname )
+read_config( const char *fname, int depth )
{
FILE *fp;
char *line, *savefname, *saveline;
vals[1].bv_val = NULL;
- cargv = ch_calloc( ARGS_STEP + 1, sizeof(*cargv) );
- cargv_size = ARGS_STEP + 1;
+ if ( depth == 0 ) {
+ cargv = ch_calloc( ARGS_STEP + 1, sizeof(*cargv) );
+ cargv_size = ARGS_STEP + 1;
+ }
if ( (fp = fopen( fname, "r" )) == NULL ) {
ldap_syslog = 1;
savefname = ch_strdup( cargv[1] );
savelineno = lineno;
- if ( read_config( savefname ) != 0 ) {
+ if ( read_config( savefname, depth+1 ) != 0 ) {
return( 1 );
}
}
fclose( fp );
+ if ( depth == 0 ) ch_free( cargv );
+
if ( load_ucdata( NULL ) < 0 ) return 1;
return( 0 );
}
exit( EXIT_FAILURE );
}
- rc = read_config( conffile );
+ rc = read_config( conffile, 0 );
if ( rc != 0 ) {
fprintf( stderr, "%s: bad configuration file!\n", progname );