From 059c0b6189101525fffdbbf8c48632776b3ca2da Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 14 Sep 2015 17:12:52 +0200 Subject: some functions behave like malloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libkeccak/mac/hmac.h | 4 ++-- src/libkeccak/state.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/libkeccak/mac/hmac.h b/src/libkeccak/mac/hmac.h index 7e12ebd..fe6f992 100644 --- a/src/libkeccak/mac/hmac.h +++ b/src/libkeccak/mac/hmac.h @@ -131,7 +131,7 @@ int libkeccak_hmac_initialise(libkeccak_hmac_state_t* restrict state, const libk * @param key_length The length of key, in bits * @return The state, `NULL` on error */ -static inline __attribute__((nonnull, unused, warn_unused_result)) +static inline __attribute__((nonnull, unused, warn_unused_result, malloc)) libkeccak_hmac_state_t* libkeccak_hmac_create(const libkeccak_spec_t* restrict spec, const char* restrict key, size_t key_length) { @@ -257,7 +257,7 @@ int libkeccak_hmac_copy(libkeccak_hmac_state_t* restrict dest, const libkeccak_h * @param src The state to duplicate * @return The duplicate, `NULL` on error */ -static inline __attribute__((nonnull, unused, warn_unused_result)) +static inline __attribute__((nonnull, unused, warn_unused_result, malloc)) libkeccak_hmac_state_t* libkeccak_hmac_duplicate(const libkeccak_hmac_state_t* restrict src) { libkeccak_hmac_state_t* restrict dest = malloc(sizeof(libkeccak_hmac_state_t)); diff --git a/src/libkeccak/state.h b/src/libkeccak/state.h index 21c7181..75af84a 100644 --- a/src/libkeccak/state.h +++ b/src/libkeccak/state.h @@ -186,7 +186,7 @@ void libkeccak_state_destroy(volatile libkeccak_state_t* restrict state) * @param spec The specifications for the state * @return The state, `NULL` on error */ -static inline __attribute__((nonnull, unused, warn_unused_result)) +static inline __attribute__((nonnull, unused, warn_unused_result, malloc)) libkeccak_state_t* libkeccak_state_create(const libkeccak_spec_t* restrict spec) { libkeccak_state_t* restrict state = malloc(sizeof(libkeccak_state_t)); @@ -243,7 +243,7 @@ int libkeccak_state_copy(libkeccak_state_t* restrict dest, const libkeccak_state * @param src The state to duplicate * @return The duplicate, `NULL` on error */ -static inline __attribute__((nonnull, unused, warn_unused_result)) +static inline __attribute__((nonnull, unused, warn_unused_result, malloc)) libkeccak_state_t* libkeccak_state_duplicate(const libkeccak_state_t* restrict src) { libkeccak_state_t* restrict dest = malloc(sizeof(libkeccak_state_t)); -- cgit v1.2.3-70-g09d2