/* Opening CTF files.
- Copyright (C) 2019 Free Software Foundation, Inc.
+ Copyright (C) 2019-2020 Free Software Foundation, Inc.
This file is part of libctf.
(err = flip_ctf (hp, fp->ctf_buf)) != 0)
{
/* We can be certain that flip_ctf() will have endian-flipped everything
- other than the types table when we return. In particular the header
- is fine, so set it, to allow freeing to use the usual code path. */
+ other than the types table when we return. In particular the header
+ is fine, so set it, to allow freeing to use the usual code path. */
ctf_set_base (fp, hp, fp->ctf_base);
goto bad;
if (fp->ctf_parent != NULL)
{
+ fp->ctf_parent->ctf_refcnt--;
ctf_file_close (fp->ctf_parent);
fp->ctf_parent = NULL;
}
fp->ctf_flags |= LCTF_CHILD;
pfp->ctf_refcnt++;
}
+
fp->ctf_parent = pfp;
return 0;
}