summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/s_free
blob: 2911f2938af44487f7882d243b003b29fb457509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /bin/sh

t=__wt.$$
trap 'rm -f $t' 0 1 2 3 13 15

# Complain if someone uses free in the library, other than the one call in
# os_common/os_alloc.c:__wt_free_int. Strip out files in the 'utilities' directory.
find ../src -name '*.c' -o -name '*_inline.h' | grep -v 'utilities' | xargs egrep ' free\(' > $t

len=`cat $t | wc -l`
test "$len" -ne "1" && {
    echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
    echo 'Calls to the C library version of free. Only __wt_free_int allowed.'
    echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
    cat $t
    exit 1
}
exit 0