]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: ctf_archive_iter: fix tiny leak
authorNick Alcock <nick.alcock@oracle.com>
Fri, 26 Apr 2024 17:10:00 +0000 (18:10 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 17 May 2024 11:58:17 +0000 (12:58 +0100)
commit2dd3fd0de417e62bb3cd9b01c4b4f35e372905cf
tree64a47524bf0b4f4580725b1e3fbdb61e81543035
parent61914bb6990c943c65fa8e10b1577c0808016149
libctf: ctf_archive_iter: fix tiny leak

If iteration fails because opening a dict has failed, ctf_archive_next does
not destroy the iterator, so the caller can keep going and try to open other
dicts further into the archive.  ctf_archive_iter just returns, though, so
it should free the iterator rather than leaking it.

libctf/
* ctf-archive.c (ctf_archive_iter): Don't leak the iterator on
failure.
libctf/ctf-archive.c