Skip to content

Commit

Permalink
Fix memory leaks in test-productdb.c
Browse files Browse the repository at this point in the history
* Fixed several memory leaks in test-productdb.c
  • Loading branch information
jirihnidek committed Mar 6, 2024
1 parent b7a3596 commit 01f65d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/libdnf/test-productdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 01f65d2

Please sign in to comment.