X-Git-Url: https://repo.jachan.dev/binutils.git/blobdiff_plain/250d07de5cf6efc81ed934c25292beb63c7e3129..HEAD:/libctf/ctf-util.c diff --git a/libctf/ctf-util.c b/libctf/ctf-util.c index 879ebbfcc4..db0b6a59bd 100644 --- a/libctf/ctf-util.c +++ b/libctf/ctf-util.c @@ -1,5 +1,5 @@ /* Miscellaneous utilities. - Copyright (C) 2019-2021 Free Software Foundation, Inc. + Copyright (C) 2019-2022 Free Software Foundation, Inc. This file is part of libctf. @@ -283,9 +283,8 @@ ctf_next_destroy (ctf_next_t *i) if (i->ctn_iter_fun == (void (*) (void)) ctf_dynhash_next_sorted) free (i->u.ctn_sorted_hkv); - if (i->ctn_iter_fun == (void (*) (void)) ctf_symbol_next - && i->cu.ctn_fp->ctf_flags & LCTF_RDWR) - ctf_next_destroy (i->u.ctn_next); + if (i->ctn_next) + ctf_next_destroy (i->ctn_next); free (i); }