don't leak memory when throwing an exception

This commit is contained in:
Axel Kohlmeyer
2024-08-20 01:15:53 -04:00
parent 8cfd856296
commit 02752ddf6a
4 changed files with 22 additions and 1 deletions

View File

@ -232,6 +232,7 @@ TEST_F(FileOperationsTest, read_lines_from_file)
rv = utils::read_lines_from_file(fp, 2, MAX_BUF_SIZE / 2, buf, me, world);
ASSERT_EQ(rv, 1);
delete[] buf;
if (me == 0) fclose(fp);
}
TEST_F(FileOperationsTest, logmesg)