diff options
Diffstat (limited to 'src/secp256k1/src/util.h')
-rw-r--r-- | src/secp256k1/src/util.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/secp256k1/src/util.h b/src/secp256k1/src/util.h index 08b23a9d38..c3a8f3a42b 100644 --- a/src/secp256k1/src/util.h +++ b/src/secp256k1/src/util.h @@ -61,6 +61,12 @@ #define VERIFY_CHECK(cond) do { (void)(cond); } while(0) #endif +static inline void *checked_malloc(size_t size) { + void *ret = malloc(size); + CHECK(ret != NULL); + return ret; +} + /* Macro for restrict, when available and not in a VERIFY build. */ #if defined(SECP256K1_BUILD) && defined(VERIFY) # define SECP256K1_RESTRICT |