Skip to content

Commit b0f200c

Browse files
authored
fixed #14619/#14620 - fixed potential memory leak using --rule / suppressed valgrind false positive (danmar#8365)
1 parent c24bf0e commit b0f200c

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/asan.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
env:
2424
QT_VERSION: 6.10.0
2525
ASAN_OPTIONS: detect_stack_use_after_return=1
26-
LSAN_OPTIONS: suppressions=lsan-suppr.txt:print_suppressions=0
2726
# TODO: figure out why there are cache misses with PCH enabled
2827
CCACHE_SLOPPINESS: pch_defines,time_macros
2928

@@ -100,7 +99,6 @@ jobs:
10099
101100
- name: Run CTest
102101
run: |
103-
cp lsan-suppr.txt cmake.output/bin
104102
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
105103
106104
- name: Run test/cli

.github/workflows/valgrind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Run valgrind
5252
run: |
5353
ec=0
54-
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate 9>memcheck.log || ec=1
54+
valgrind --error-limit=yes --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --suppressions=valgrind/testrunner.supp --gen-suppressions=all -s --log-fd=9 --error-exitcode=42 ./testrunner TestGarbage TestOther TestSimplifyTemplate TestRegEx 9>memcheck.log || ec=1
5555
cat memcheck.log
5656
exit $ec
5757
# TODO: debuginfod.ubuntu.com is currently not responding to any requests causing it to run into a 40(!) minute timeout

lib/regex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace {
167167
~PcreRegex() override
168168
{
169169
if (mExtra) {
170-
pcre_free(mExtra);
170+
pcre_free_study(mExtra);
171171
mExtra = nullptr;
172172
}
173173
if (mRe) {

lsan-suppr.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

valgrind/testrunner.supp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@
1414
obj:*
1515
obj:*
1616
}
17+
{
18+
TestRegEx::partialmatch false positive
19+
Memcheck:Cond
20+
obj:*
21+
obj:*
22+
}

0 commit comments

Comments
 (0)