lib/traverse: Fix minor memory leak
authorColin Walters <walters@verbum.org>
Tue, 20 Aug 2024 20:18:54 +0000 (16:18 -0400)
committerColin Walters <walters@verbum.org>
Fri, 6 Sep 2024 22:52:33 +0000 (18:52 -0400)
commitbd5b4adccdbca18dccd308035412a6ad4972d4d4
treeccf096fb60949250490be5bd96c05c456eb8e4a6
parentfbb1cc7e3886b1389bd6b290ed51e150f9a7abc8
lib/traverse: Fix minor memory leak

I was trying to check something with `-fsanitize=address`
and it warned about this memory leak. It's...subtle, basically
we were leaking when the same commit was added to the hash table.

But unfortunately fixing that then complicates ownership
over the return value; what we really want to use here is
`g_hash_table_steal_all_keys` but RHEL 9.4 is still rocking
`glib2-2.68.4` so we can't use it.

(Rust would mean we wouldn't have leaked anything here in the
 first place...)

Signed-off-by: Colin Walters <walters@verbum.org>
src/libostree/ostree-repo-traverse.c