From 2c7a5f7bee2bcf312bb09463886dfffa9cd28e84 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 12 Apr 2024 13:00:00 +0200 Subject: [PATCH] [winpr,env] WINPR_ATTR_MALLOC mark the free functions for environment strings --- winpr/include/winpr/environment.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/winpr/include/winpr/environment.h b/winpr/include/winpr/environment.h index f530d59c9..c963f8c9c 100644 --- a/winpr/include/winpr/environment.h +++ b/winpr/include/winpr/environment.h @@ -87,7 +87,13 @@ extern "C" * http://blogs.msdn.com/b/oldnewthing/archive/2013/01/17/10385718.aspx */ + WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock); + WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock); + + WINPR_ATTR_MALLOC(FreeEnvironmentStringsA, 1) WINPR_API LPCH GetEnvironmentStrings(VOID); + + WINPR_ATTR_MALLOC(FreeEnvironmentStringsW, 1) WINPR_API LPWCH GetEnvironmentStringsW(VOID); WINPR_API BOOL SetEnvironmentStringsA(LPCH NewEnvironment); @@ -96,9 +102,6 @@ extern "C" WINPR_API DWORD ExpandEnvironmentStringsA(LPCSTR lpSrc, LPSTR lpDst, DWORD nSize); WINPR_API DWORD ExpandEnvironmentStringsW(LPCWSTR lpSrc, LPWSTR lpDst, DWORD nSize); - WINPR_API BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock); - WINPR_API BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock); - #ifdef __cplusplus } #endif