xref: /netbsd-src/crypto/external/bsd/openssl/dist/util/check-malloc-errs (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos#! /bin/sh
213d40330Schristos# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
313d40330Schristos#
4*b0d17251Schristos# Licensed under the Apache License 2.0 (the "License").  You may not use
513d40330Schristos# this file except in compliance with the License.  You can obtain a copy
613d40330Schristos# in the file LICENSE in the source distribution or at
713d40330Schristos# https://www.openssl.org/source/license.html
813d40330Schristos
913d40330Schristos(
1013d40330Schristos    pcregrep -rnM 'OPENSSL_.?alloc.*\n.*if.*NULL.*\n.*return'  crypto ssl
1113d40330Schristos    pcregrep -rnM 'if.*OPENSSL_.?alloc.*NULL.*\n.*.*return' crypto ssl
1213d40330Schristos) | tee /tmp/out$$
1313d40330SchristosX=0
1413d40330Schristostest -s /tmp/out$$ && X=1
1513d40330Schristosrm /tmp/out$$
1613d40330Schristosexit $X
17