which is the case when there's no impersonation.
size_t ptc_sid_len;
if (!pSid) {
- bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
- if (!bucket_key) {
- *key_len = 0;
- return NULL;
- }
- memcpy(bucket_key, pathname, pathname_len);
*key_len = pathname_len;
- return bucket_key;
+ return pathname;
}
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
h *= Z_UL(16777619);
h ^= *bucket_key++;
}
- HeapFree(GetProcessHeap(), 0, (LPVOID)bucket_key_start);
+ if (bucket_key_start != path) {
+ HeapFree(GetProcessHeap(), 0, (LPVOID)bucket_key_start);
+ }
return h;
}
/* }}} */