aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/common/ctf/ctf_open.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2013-08-23 23:21:24 +0000
committerXin LI <delphij@FreeBSD.org>2013-08-23 23:21:24 +0000
commit3f0164abf32b9b761e0a2cb4bdca3a8b84f156d4 (patch)
treead32c6f1bbf74e601fd4395f5a07217ce6a2de60 /cddl/contrib/opensolaris/common/ctf/ctf_open.c
parent2adf57829e4883498a3534ae7a11d63bdd7aaaee (diff)
parentd5c2dea67b865ff920561f44fe5ac092ccdf581f (diff)
downloadsrc-3f0164abf32b9b761e0a2cb4bdca3a8b84f156d4.tar.gz
src-3f0164abf32b9b761e0a2cb4bdca3a8b84f156d4.zip
MFV r254422:
Illumos DTrace issues: 3089 want ::typedef 3094 libctf should support removing a dynamic type 3095 libctf does not validate arrays correctly 3096 libctf does not validate function types correctly
Notes
Notes: svn path=/head/; revision=254744
Diffstat (limited to 'cddl/contrib/opensolaris/common/ctf/ctf_open.c')
-rw-r--r--cddl/contrib/opensolaris/common/ctf/ctf_open.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_open.c b/cddl/contrib/opensolaris/common/ctf/ctf_open.c
index e49a4cb32934..2148389fff80 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_open.c
+++ b/cddl/contrib/opensolaris/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);
}