patch from Honza Horak using Coverity's static analysis tool.

This commit is contained in:
rocky
2011-05-30 15:19:22 -04:00
parent 9be0980337
commit 940b7cd848
20 changed files with 52 additions and 28 deletions

View File

@@ -198,11 +198,13 @@ check_mounts_linux(const char *mtab)
}
}
}
if ( strcmp(mnt_type, "iso9660") == 0 ) {
if (is_cdrom_linux(mnt_dev, mnt_type) > 0) {
free(mnt_type);
endmntent(mntfp);
return mnt_dev;
if ( mnt_type && mnt_dev ) {
if ( strcmp(mnt_type, "iso9660") == 0 ) {
if (is_cdrom_linux(mnt_dev, mnt_type) > 0) {
free(mnt_type);
endmntent(mntfp);
return mnt_dev;
}
}
}
free(mnt_dev);