我對某些操作使用GetSidIdentifierAuthority函數,它返回一個指針。完成之後,我想釋放這個指針。但是,每當我嘗試釋放它,它立即崩潰。處理GetSidIdentifierAuthority函數的返回值
PSID_IDENTIFIER_AUTHORITY pSid= NULL;
EXPLICIT_ACCESS *pEa= NULL;
PACL pACL = NULL;
ULONG eaSize = 0;
DWORD dwRes = 0;
//some initialization
dwRes = GetExplicitEntriesFromAcl(pACL, &eaSize, &pEa);
pSid= GetSidIdentifierAuthority(pEa[0].Trustee.ptstrName);
//Here GetLastError returns sucess
LocalFree((HLOCAL)pEa); //This call success
LocalFree((HLOCAL)pACL); //This call success
LocalFree(pSid); //This call crushes
在我看來,因爲這是一個指針,GetSidIdentifierAuthority已經回來了,應該由我解脫出來,但我不能夠做到這一點。這裏有什麼可能是錯的?