Currently, we do not check if the argument of afsconf_Close /
afsconf_CloseInternal is equal to null. In order to avoid a possible
segmentation fault, add the checks.
Change-Id: I45635ad2d735505637072867edb7ff17da3c671a
Reviewed-on: https://gerrit.openafs.org/13352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
int
afsconf_Close(struct afsconf_dir *adir)
{
+ if (adir == NULL) {
+ return 0;
+ }
+
LOCK_GLOBAL_MUTEX;
afsconf_CloseInternal(adir);
if (adir->name)
struct afsconf_aliasentry *ta, *na;
char *tname;
+ if (adir == NULL) {
+ return 0;
+ }
+
tname = adir->name; /* remember name, since that's all we preserve */
/* free everything we can find */