From 9716a1a97d1a50c79b881af4e1247fdf6df0b61e Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Fri, 27 Jan 2023 15:51:44 -0700 Subject: [PATCH] include: Remove __WINE_MALLOC from functions that shouldn't have it. According to the GCC documentation,[1] __attribute__((malloc)) may not be used on functions that return memory that contains one or more valid pointers. [1] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html --- include/adshlp.h | 2 +- include/threadpoolapiset.h | 12 ++++++------ include/winber.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/adshlp.h b/include/adshlp.h index 5dacbb6b821..7366c077788 100644 --- a/include/adshlp.h +++ b/include/adshlp.h @@ -25,7 +25,7 @@ extern "C" { BOOL WINAPI FreeADsMem(void*); void* WINAPI AllocADsMem(DWORD) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(FreeADsMem) __WINE_MALLOC; -void* WINAPI ReallocADsMem(void*,DWORD,DWORD) __WINE_ALLOC_SIZE(3) __WINE_DEALLOC(FreeADsMem) __WINE_MALLOC; +void* WINAPI ReallocADsMem(void*,DWORD,DWORD) __WINE_ALLOC_SIZE(3) __WINE_DEALLOC(FreeADsMem); BOOL WINAPI FreeADsStr(WCHAR*); WCHAR* WINAPI AllocADsStr(WCHAR*) __WINE_DEALLOC(FreeADsStr) __WINE_MALLOC; diff --git a/include/threadpoolapiset.h b/include/threadpoolapiset.h index 6d8ac44a058..73203f413ee 100644 --- a/include/threadpoolapiset.h +++ b/include/threadpoolapiset.h @@ -33,17 +33,17 @@ WINBASEAPI void WINAPI CloseThreadpoolIo(TP_IO*); WINBASEAPI void WINAPI CloseThreadpoolTimer(PTP_TIMER); WINBASEAPI void WINAPI CloseThreadpoolWait(PTP_WAIT); WINBASEAPI void WINAPI CloseThreadpoolWork(PTP_WORK); -WINBASEAPI TP_POOL* WINAPI CreateThreadpool(void*) __WINE_DEALLOC(CloseThreadpool) __WINE_MALLOC; +WINBASEAPI TP_POOL* WINAPI CreateThreadpool(void*) __WINE_DEALLOC(CloseThreadpool); WINBASEAPI TP_CLEANUP_GROUP* WINAPI CreateThreadpoolCleanupGroup(void) - __WINE_DEALLOC(CloseThreadpoolCleanupGroup) __WINE_MALLOC; + __WINE_DEALLOC(CloseThreadpoolCleanupGroup); WINBASEAPI TP_IO* WINAPI CreateThreadpoolIo(HANDLE,PTP_WIN32_IO_CALLBACK,void*,TP_CALLBACK_ENVIRON*) - __WINE_DEALLOC(CloseThreadpoolIo) __WINE_MALLOC; + __WINE_DEALLOC(CloseThreadpoolIo); WINBASEAPI TP_TIMER* WINAPI CreateThreadpoolTimer(PTP_TIMER_CALLBACK,void*,TP_CALLBACK_ENVIRON*) - __WINE_DEALLOC(CloseThreadpoolTimer) __WINE_MALLOC; + __WINE_DEALLOC(CloseThreadpoolTimer); WINBASEAPI TP_WAIT* WINAPI CreateThreadpoolWait(PTP_WAIT_CALLBACK,void*,TP_CALLBACK_ENVIRON*) - __WINE_DEALLOC(CloseThreadpoolWait) __WINE_MALLOC; + __WINE_DEALLOC(CloseThreadpoolWait); WINBASEAPI TP_WORK* WINAPI CreateThreadpoolWork(PTP_WORK_CALLBACK,void*,TP_CALLBACK_ENVIRON*) - __WINE_DEALLOC(CloseThreadpoolWork) __WINE_MALLOC; + __WINE_DEALLOC(CloseThreadpoolWork); WINBASEAPI void WINAPI DisassociateCurrentThreadFromCallback(PTP_CALLBACK_INSTANCE); WINBASEAPI void WINAPI FreeLibraryWhenCallbackReturns(PTP_CALLBACK_INSTANCE,HMODULE); WINBASEAPI BOOL WINAPI IsThreadpoolTimerSet(PTP_TIMER); diff --git a/include/winber.h b/include/winber.h index 83055fa8c72..cb4f8e3ff54 100644 --- a/include/winber.h +++ b/include/winber.h @@ -29,12 +29,12 @@ typedef unsigned int ber_len_t; void CDECL ber_free( BerElement *, int ); void CDECL ber_bvfree( BERVAL * ); -BerElement * CDECL ber_alloc_t( int ) __WINE_DEALLOC(ber_free) __WINE_MALLOC; -BERVAL * CDECL ber_bvdup( BERVAL * ) __WINE_DEALLOC(ber_bvfree) __WINE_MALLOC; +BerElement * CDECL ber_alloc_t( int ) __WINE_DEALLOC(ber_free); +BERVAL * CDECL ber_bvdup( BERVAL * ) __WINE_DEALLOC(ber_bvfree); void CDECL ber_bvecfree( BERVAL ** ); ULONG CDECL ber_first_element( BerElement *, ULONG *, char ** ); int CDECL ber_flatten( BerElement *, BERVAL ** ); -BerElement * CDECL ber_init( BERVAL * ) __WINE_DEALLOC(ber_free) __WINE_MALLOC; +BerElement * CDECL ber_init( BERVAL * ) __WINE_DEALLOC(ber_free); ULONG CDECL ber_next_element( BerElement *, ULONG *, char * ); ULONG CDECL ber_peek_tag( BerElement *, ULONG * ); int WINAPIV ber_printf( BerElement *, char *, ... );