blob: ca35ec1443cfc77ac97d7848764e8aefd268f8c2 [file] [log] [blame]
Denis Vlasenkof962a032007-11-23 12:50:54 +00001#!/bin/sh
2
3# hush's stderr with leak debug enabled
4output=output
5
6freelist=`grep 'free 0x' "$output" | cut -d' ' -f2 | sort | uniq | xargs`
7
Denis Vlasenko14725f82009-04-08 16:46:45 +00008grep -v free "$output" >"$output.leaked"
Denis Vlasenkodcd78c42009-04-19 23:07:51 +00009
10i=8
11list=
Denis Vlasenkof962a032007-11-23 12:50:54 +000012for freed in $freelist; do
Denis Vlasenkodcd78c42009-04-19 23:07:51 +000013 list="$list -e $freed"
14 test $((--i)) != 0 && continue
15 echo Dropping $list
16 grep -F -v $list <"$output.leaked" >"$output.temp"
Denis Vlasenko14725f82009-04-08 16:46:45 +000017 mv "$output.temp" "$output.leaked"
Denis Vlasenkodcd78c42009-04-19 23:07:51 +000018 i=8
19 list=
Denis Vlasenkof962a032007-11-23 12:50:54 +000020done
Denis Vlasenkodcd78c42009-04-19 23:07:51 +000021if test "$list"; then
22 echo Dropping $list
23 grep -F -v $list <"$output.leaked" >"$output.temp"
24 mv "$output.temp" "$output.leaked"
25fi