Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
struct dom_sid **sids, uint32_t *num)
{
- *sids = talloc_realloc(mem_ctx, *sids, struct dom_sid,
- (*num)+1);
- if (*sids == NULL) {
+ struct dom_sid *tmp;
+
+ tmp = talloc_realloc(mem_ctx, *sids, struct dom_sid, (*num)+1);
+ if (tmp == NULL) {
*num = 0;
return NT_STATUS_NO_MEMORY;
}
+ *sids = tmp;
sid_copy(&((*sids)[*num]), sid);
*num += 1;