From b137fdc5aef7fe0950e9090252a60f0abf3c23dc Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Thu, 22 Feb 2024 16:50:24 +0100 Subject: [PATCH] Fix memory leaks in test-productdb.c * Fixed several memory leaks in test-productdb.c --- src/plugins/libdnf/test-productdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/libdnf/test-productdb.c b/src/plugins/libdnf/test-productdb.c index 018eb3b951..3c708c4ec6 100644 --- a/src/plugins/libdnf/test-productdb.c +++ b/src/plugins/libdnf/test-productdb.c @@ -179,6 +179,8 @@ void testReadCorruptedFile(dbFixture *fixture, gconstpointer ignored) { g_assert_nonnull(err); g_clear_error(&err); g_assert_cmpint(g_hash_table_size(db->repoMap), ==, 0); + g_free(path); + g_object_unref(testJsonFile); } void testReadFileWrongData(dbFixture *fixture, gconstpointer ignored) { @@ -222,6 +224,8 @@ void testReadFileWrongData(dbFixture *fixture, gconstpointer ignored) { g_clear_error(&err); g_io_stream_close((GIOStream*) ioStream, NULL, &err); + g_free(path); + g_object_unref(testJsonFile); } void testWriteFile(dbFixture *fixture, gconstpointer ignored) {