Skip to content

Commit

Permalink
Fix valgrind check to ignore bash leak
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkiDev committed Aug 10, 2020
1 parent 0232239 commit 3444b11
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ EXTRA_DIST+= wolfssl-ntru.sln
EXTRA_DIST+= wolfssl.sln
EXTRA_DIST+= wolfssl64.sln
EXTRA_DIST+= valgrind-error.sh
EXTRA_DIST+= valgrind-bash.supp
EXTRA_DIST+= fips-hash.sh
EXTRA_DIST+= gencertbuf.pl
EXTRA_DIST+= README.md
Expand Down
8 changes: 8 additions & 0 deletions valgrind-bash.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
linux_bash_locale_leak
Memcheck:Leak
fun:malloc
fun:xmalloc
fun:set_default_locale
fun:main
}
10 changes: 6 additions & 4 deletions valgrind-error.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
#
# Our valgrind "error" wrapper.

valgrind --leak-check=full -q "$@" 2> valgrind.tmp
TMP="valgrind.tmp.$$"

valgrind --suppressions=valgrind-bash.supp --leak-check=full -q "$@" 2> $TMP

result="$?"

# verify no errors

output="`cat valgrind.tmp`"
output="`cat $TMP`"

if [ "$output" != "" ]; then
cat valgrind.tmp >&2
cat $TMP >&2
result=1
fi

rm valgrind.tmp
rm $TMP

exit $result

0 comments on commit 3444b11

Please sign in to comment.