Unchecked popen/pclose Return Values

This commit is contained in:
2025-12-07 18:48:38 +01:00
parent bc4083a98c
commit bcabad0620

View File

@ -405,6 +405,7 @@ void reHDD::filterIgnoredDrives(list<Drive> *plistDrives)
FILE *outputfileBlkid = popen(sCMD.c_str(), "r"); // get UUID from drive
if (outputfileBlkid == NULL)
{
pclose(outputfileBlkid);
exit(EXIT_FAILURE);
}
@ -684,6 +685,7 @@ bool reHDD::getSystemDrive(string &systemDrive)
if (outputfileHwinfo == NULL)
{
Logger::logThis()->error("Unable to scan attached drives for system drive");
pclose(outputfileHwinfo);
exit(EXIT_FAILURE);
}