If cellName was just set to dir->cellName, afsconf_Close() will
free the string before fprintf uses it. Just change the order
so we don't access freed memory and print garbage.
Change-Id: I66792dc50addf2d8242f71923db09fcc178cc450
Reviewed-on: http://gerrit.openafs.org/9886
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
code = afsconf_GetCellInfo(dir, cellName, serviceid, &info);
if (code) {
- afsconf_Close(dir);
fprintf(stderr, "%s: can't find cell %s's hosts in %s/%s\n",
progname?progname:"<unknown>", cellName, confDir,
AFSDIR_CELLSERVDB_FILE);
+ afsconf_Close(dir);
return code;
}