summaryrefslogtreecommitdiff
path: root/usr/src/common/ctf/ctf_open.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2012-11-13 23:48:19 +0000
committerRobert Mustacchi <rm@joyent.com>2012-11-21 07:08:21 +0000
commit66bbd2b9c817e75f72b055981eb23eaee4f74846 (patch)
treeb88c5af8027e9f5e5d76a42fbf340ba55964e72a /usr/src/common/ctf/ctf_open.c
parentb6074390f3ef84676ad2ba8f216cd685b0b92e04 (diff)
downloadillumos-joyent-66bbd2b9c817e75f72b055981eb23eaee4f74846.tar.gz
OS-1474 Want ::typedef
OS-1598 Want mdb -e OS-1600 Want an mdb test suite driver OS-1632 mdb on x86 should be able to print alternate register names OS-1699 libctf should support removing a dynamic type OS-1700 libctf does not validate arrays correctly OS-1701 libctf does not validate function types correctly
Diffstat (limited to 'usr/src/common/ctf/ctf_open.c')
-rw-r--r--usr/src/common/ctf/ctf_open.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/common/ctf/ctf_open.c b/usr/src/common/ctf/ctf_open.c
index e49a4cb329..2148389fff 100644
--- a/usr/src/common/ctf/ctf_open.c
+++ b/usr/src/common/ctf/ctf_open.c
@@ -24,8 +24,9 @@
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
#include <ctf_impl.h>
#include <sys/mman.h>
@@ -810,8 +811,12 @@ ctf_close(ctf_file_t *fp)
if (fp->ctf_parent != NULL)
ctf_close(fp->ctf_parent);
- for (dtd = ctf_list_next(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) {
- ntd = ctf_list_next(dtd);
+ /*
+ * Note, to work properly with reference counting on the dynamic
+ * section, we must delete the list in reverse.
+ */
+ for (dtd = ctf_list_prev(&fp->ctf_dtdefs); dtd != NULL; dtd = ntd) {
+ ntd = ctf_list_prev(dtd);
ctf_dtd_delete(fp, dtd);
}