Skip to content

Commit 3c84edb

Browse files
committed
Minor fix
1 parent 076eb8a commit 3c84edb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,14 @@ SanitizerInterceptor::~SanitizerInterceptor() {
154154
DestroyShadowMemoryOnCPU();
155155
DestroyShadowMemoryOnPVC();
156156

157-
if (!m_AllocationMap.empty()) {
158-
for (const auto &[_, AI] : m_AllocationMap) {
159-
if (!AI->IsReleased) {
160-
ReportMemoryLeak(AI);
161-
}
157+
bool HasLeak = false;
158+
for (const auto &[_, AI] : m_AllocationMap) {
159+
if (!AI->IsReleased) {
160+
HasLeak = true;
161+
ReportMemoryLeak(AI);
162162
}
163+
}
164+
if (HasLeak) {
163165
exit(1);
164166
}
165167
}

0 commit comments

Comments
 (0)