diff --git a/require-ess/src/require.c b/require-ess/src/require.c index 21cb4ad43b70640d43e2c08fd2856d2e3ee4ee3a..1156c2d1ac2571c83f27dbd42c7e4d2fc91e459f 100644 --- a/require-ess/src/require.c +++ b/require-ess/src/require.c @@ -518,7 +518,8 @@ void registerModule(const char *module, const char *version, const char *locatio size_t lm = strlen(module) + 1; size_t lv = (version ? strlen(version) : 0) + 1; size_t ll = 1; - char *abslocation = NULL; + char *absLocation = NULL; + char *absLocationRequire = NULL; char *argstring = NULL; const char *mylocation; static int firstTime = 1; @@ -539,8 +540,8 @@ void registerModule(const char *module, const char *version, const char *locatio if (location) { - abslocation = realpathSeparator(location); - ll = strlen(abslocation) + 1; + absLocation = realpathSeparator(location); + ll = strlen(absLocation) + 1; } m = (moduleitem *)malloc(sizeof(moduleitem) + lm + lv + ll); if (m == NULL) @@ -553,9 +554,9 @@ void registerModule(const char *module, const char *version, const char *locatio strcpy(m->content, module); strcpy(m->content + lm, version); - strcpy(m->content + lm + lv, abslocation ? abslocation : ""); + strcpy(m->content + lm + lv, absLocation ? absLocation : ""); - free(abslocation); + free(absLocation); for (pm = &loadedModules; *pm != NULL; pm = &(*pm)->next) ; *pm = m; @@ -580,7 +581,7 @@ void registerModule(const char *module, const char *version, const char *locatio mylocation = getenv("require_DIR"); if (mylocation == NULL) return; - if (asprintf(&abslocation, "%s" OSI_PATH_SEPARATOR "db" OSI_PATH_SEPARATOR "moduleversion.template", mylocation) < 0) + if (asprintf(&absLocationRequire, "%s" OSI_PATH_SEPARATOR "db" OSI_PATH_SEPARATOR "moduleversion.template", mylocation) < 0) return; /* Require DB has the following four PVs: @@ -597,9 +598,9 @@ void registerModule(const char *module, const char *version, const char *locatio moduleListBufferSize + maxModuleNameLength * moduleCount) < 0) return; printf("Loading module info records for %s\n", module); - dbLoadRecords(abslocation, argstring); + dbLoadRecords(absLocationRequire, argstring); free(argstring); - free(abslocation); + free(absLocationRequire); } #if defined(__linux)