[WKSSVC] Plug memory leaks in NetrWkstaUserGetInfo

This commit is contained in:
Timo Kreuzer 2025-01-15 08:41:26 +02:00
parent 1c1c4e5d94
commit 132d571fe2

View file

@ -762,6 +762,7 @@ NetrWkstaUserGetInfo(
if (pUserInfo->UserInfo0.wkui0_username == NULL)
{
ERR("\n");
midl_user_free(pUserInfo);
dwResult = ERROR_NOT_ENOUGH_MEMORY;
break;
}
@ -792,6 +793,7 @@ NetrWkstaUserGetInfo(
if (pUserInfo->UserInfo1.wkui1_username == NULL)
{
ERR("\n");
midl_user_free(pUserInfo);
dwResult = ERROR_NOT_ENOUGH_MEMORY;
break;
}
@ -808,6 +810,8 @@ NetrWkstaUserGetInfo(
if (pUserInfo->UserInfo1.wkui1_logon_domain == NULL)
{
ERR("\n");
midl_user_free(pUserInfo->UserInfo1.wkui1_username);
midl_user_free(pUserInfo);
dwResult = ERROR_NOT_ENOUGH_MEMORY;
break;
}
@ -826,6 +830,9 @@ NetrWkstaUserGetInfo(
if (pUserInfo->UserInfo1.wkui1_logon_server == NULL)
{
ERR("\n");
midl_user_free(pUserInfo->UserInfo1.wkui1_username);
midl_user_free(pUserInfo->UserInfo1.wkui1_logon_domain);
midl_user_free(pUserInfo);
dwResult = ERROR_NOT_ENOUGH_MEMORY;
break;
}