From: Eugene Syromiatnikov Date: Mon, 11 Aug 2025 08:56:13 +0000 (+0200) Subject: Remove OSSL_CRYPTO_ALLOC attribute from CRYPTO_*dup routines X-Git-Tag: openssl-3.6.0-alpha1~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85bba74789f82daca7482a9274c6d02843fb2dbb;p=thirdparty%2Fopenssl.git Remove OSSL_CRYPTO_ALLOC attribute from CRYPTO_*dup routines The __attribute__((malloc)) is for functions that return new memory, and "the memory [returned by the function] has undefined content", which is a property that doesn't hold for the *dup functions (the same reason it doesn't apply to realloc). Fixes: e1035957eba1 "OSSL_CRYPTO_ALLOC attribute introduction proposal." Signed-off-by: Eugene Syromiatnikov Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/28220) --- diff --git a/include/openssl/crypto.h.in b/include/openssl/crypto.h.in index 57b2f3a1dc5..92be9275a61 100644 --- a/include/openssl/crypto.h.in +++ b/include/openssl/crypto.h.in @@ -358,9 +358,9 @@ OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc(size_t num, size_t align, OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc_array(size_t num, size_t size, size_t align, void **freeptr, const char *file, int line); -OSSL_CRYPTO_ALLOC void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line); -OSSL_CRYPTO_ALLOC char *CRYPTO_strdup(const char *str, const char *file, int line); -OSSL_CRYPTO_ALLOC char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line); +void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line); +char *CRYPTO_strdup(const char *str, const char *file, int line); +char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line); void CRYPTO_free(void *ptr, const char *file, int line); void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line); void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);