Skip to content

Commit 2bb223e

Browse files
committed
Call dlclose() only when dlsym() fails.
1 parent 03888a9 commit 2bb223e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libunwind/src/UnwindCursor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,8 +2151,8 @@ bool UnwindCursor<A, R>::getInfoFromTBTable(pint_t pc, R &registers) {
21512151
if (xlcPersonalityV0 == NULL) {
21522152
_LIBUNWIND_TRACE_UNWINDING("dlsym() failed with errno=%d\n", errno);
21532153
assert(0 && "dlsym() failed");
2154+
dlclose(libHandle);
21542155
}
2155-
dlclose(libHandle);
21562156
errno = saveErrno;
21572157
}
21582158
xlcPersonalityV0InitLock.unlock();

0 commit comments

Comments
 (0)