Closed t-w closed 7 months ago
Another one is in adfMountHdFile()
:
RETCODE adfMountHdFile ( struct AdfDevice * const dev )
{
[...]
dev->volList = (struct AdfVolume **) malloc (sizeof(struct AdfVolume *));
if (!dev->volList) {
(*adfEnv.eFct)("adfMountHdFile : malloc");
return RC_MALLOC;
}
vol = (struct AdfVolume *) malloc (sizeof(struct AdfVolume));
if (!vol) {
(*adfEnv.eFct)("adfMountHdFile : malloc");
return RC_MALLOC;
}
[...] AND ALSO BELOW ANOTHER ONE
if (vol->rootBlock==1) {
(*adfEnv.eFct)("adfMountHdFile : rootblock not found");
return RC_ERROR;
}
If allocation for
vol->volName
fails,vol
(allocated earlier, above) will never be deallocated.(A rare case, only when a mem. allocation fails - so not caught by sanitizers).