If lsmount or flushmount encounter an error, then they may include
the contents of parent_dir in their error message. However, in both
cases, this was freed a couple of lines earlier.
Just move the free() later, so that the contents of this variable
are still available.
Caught by clang-analyzer
Change-Id: Ideba52b7ba98f034baf923194007239a6cf0221f
Reviewed-on: http://gerrit.openafs.org/9193
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
code = pioctl(parent_dir, VIOC_AFS_STAT_MT_PT, &blob, 1);
free(last_component);
- free(parent_dir);
if (code == 0) {
printf("'%s' is a %smount point for volume '%s'\n", ti->data,
}
error = 1;
}
+ free(parent_dir);
}
return error;
}
code = pioctl(parent_dir, VIOC_AFS_FLUSHMOUNT, &blob, 1);
free(last_component);
- free(parent_dir);
if (code != 0) {
if (errno == EINVAL) {
}
error = 1;
}
+ free(parent_dir);
}
return error;
}