[winpr,env] add missing WINPR_ATTR_MALLOC

This commit is contained in:
akallabeth 2024-09-14 20:42:07 +02:00
parent 9cfd748b63
commit 65de25205b
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
3 changed files with 16 additions and 0 deletions

View File

@ -129,15 +129,19 @@ extern "C"
{
#endif
WINPR_ATTR_MALLOC(free, 1)
WINPR_API LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge);
WINPR_API DWORD GetEnvironmentVariableEBA(LPCSTR envBlock, LPCSTR lpName, LPSTR lpBuffer,
DWORD nSize);
WINPR_API BOOL SetEnvironmentVariableEBA(LPSTR* envBlock, LPCSTR lpName, LPCSTR lpValue);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char** EnvironmentBlockToEnvpA(LPCH lpszEnvironmentBlock);
WINPR_API DWORD GetEnvironmentVariableX(const char* lpName, char* lpBuffer, DWORD nSize);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetEnvAlloc(LPCSTR lpName);
#ifdef __cplusplus

View File

@ -306,10 +306,20 @@ extern "C"
#endif
WINPR_API const char* GetKnownPathIdString(int id);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetKnownPath(int id);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetKnownSubPath(int id, const char* path);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetEnvironmentPath(char* name);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetEnvironmentSubPath(char* name, const char* path);
WINPR_ATTR_MALLOC(free, 1)
WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath);
WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes);

View File

@ -301,6 +301,8 @@ BOOL FreeEnvironmentStringsA(LPCH lpszEnvironmentBlock)
BOOL FreeEnvironmentStringsW(LPWCH lpszEnvironmentBlock)
{
free(lpszEnvironmentBlock);
return TRUE;
}