From 8b48b47654a28b301580723b3199bace5d842d1f Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 17 Jan 2025 14:25:47 -0700 Subject: [PATCH] ckp --- libdispatch/drc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libdispatch/drc.c b/libdispatch/drc.c index 21bc70aeb5..1e58e1553b 100644 --- a/libdispatch/drc.c +++ b/libdispatch/drc.c @@ -137,15 +137,13 @@ This is set by the environment variable NC_TEST_AWS_DIR. void ncrc_initialize(void) { - int stat = NC_NOERR; - NCglobalstate* ncg = NULL; - if(NCRCinitialized) return; NCRCinitialized = 1; /* prevent recursion */ - ncg = NC_getglobalstate(); - #ifndef NOREAD + { + int stat = NC_NOERR; + NCglobalstate* ncg = NC_getglobalstate(); /* Load entrys */ if((stat = NC_rcload())) { nclog(NCLOGWARN,".rc loading failed"); @@ -154,6 +152,7 @@ ncrc_initialize(void) if((stat = NC_aws_load_credentials(ncg))) { nclog(NCLOGWARN,"AWS config file not loaded"); } + } #endif } @@ -329,7 +328,7 @@ NC_set_rcfile(const char* rcfile) goto done; } fclose(f); - nullfree(globalstate->rcinfo->rcfile); + NC_rcclear(globalstate->rcinfo); globalstate->rcinfo->rcfile = strdup(rcfile); /* Clear globalstate->rcinfo */ NC_rcclear(&globalstate->rcinfo);