diff options
Diffstat (limited to 'src/basic/alloc-util.h')
-rw-r--r-- | src/basic/alloc-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/alloc-util.h b/src/basic/alloc-util.h index 9b20be4773..cffc737d03 100644 --- a/src/basic/alloc-util.h +++ b/src/basic/alloc-util.h @@ -112,7 +112,9 @@ _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t size, si return memdup(p, size * need); } -_alloc_(2, 3) static inline void *memdup_suffix0_multiply(const void *p, size_t size, size_t need) { +/* Note that we can't decorate this function with _alloc_() since the returned memory area is one byte larger + * than the product of its parameters. */ +static inline void *memdup_suffix0_multiply(const void *p, size_t size, size_t need) { if (size_multiply_overflow(size, need)) return NULL; |