aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-open.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/ctf-open.c')
-rw-r--r--libctf/ctf-open.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libctf/ctf-open.c b/libctf/ctf-open.c
index 55f0a74..a92668f 100644
--- a/libctf/ctf-open.c
+++ b/libctf/ctf-open.c
@@ -1806,6 +1806,7 @@ ctf_dict_close (ctf_dict_t *fp)
free (fp->ctf_sxlate);
free (fp->ctf_txlate);
free (fp->ctf_ptrtab);
+ free (fp->ctf_pptrtab);
free (fp->ctf_header);
free (fp);
@@ -1931,7 +1932,8 @@ ctf_cuname_set (ctf_dict_t *fp, const char *name)
/* Import the types from the specified parent dict by storing a pointer to it in
ctf_parent and incrementing its reference count. Only one parent is allowed:
- if a parent already exists, it is replaced by the new parent. */
+ if a parent already exists, it is replaced by the new parent. The pptrtab
+ is wiped, and will be refreshed by the next ctf_lookup_by_name call. */
int
ctf_import (ctf_dict_t *fp, ctf_dict_t *pfp)
{
@@ -1945,6 +1947,11 @@ ctf_import (ctf_dict_t *fp, ctf_dict_t *pfp)
ctf_dict_close (fp->ctf_parent);
fp->ctf_parent = NULL;
+ free (fp->ctf_pptrtab);
+ fp->ctf_pptrtab = NULL;
+ fp->ctf_pptrtab_len = 0;
+ fp->ctf_pptrtab_typemax = 0;
+
if (pfp != NULL)
{
int err;
@@ -1979,6 +1986,10 @@ ctf_import_unref (ctf_dict_t *fp, ctf_dict_t *pfp)
ctf_dict_close (fp->ctf_parent);
fp->ctf_parent = NULL;
+ free (fp->ctf_pptrtab);
+ fp->ctf_pptrtab = NULL;
+ fp->ctf_pptrtab_len = 0;
+ fp->ctf_pptrtab_typemax = 0;
if (pfp != NULL)
{
int err;