}
TEST(CDROMTest, FindMountPointForDevice)
{
- char * tempfile = NULL;
+ std::string tempfile;
FileFd fd;
createTemporaryFile("mountpoints", fd, &tempfile,
"rootfs / rootfs rw 0 0\n"
EXPECT_EQ("/boot/efi", FindMountPointForDevice("/dev/sda1"));
EXPECT_EQ("/tmp", FindMountPointForDevice("tmpfs"));
- if (tempfile != NULL)
- unlink(tempfile);
- free(tempfile);
+ if (tempfile.empty() == false)
+ unlink(tempfile.c_str());
}