From e84ead0cfdc5e45a577387cc54dceb4c3f32948a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Mar 2005 16:33:04 +0000 Subject: r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the change in pdb_enum_alias_memberships to match samr.idl a bit closer. Volker (This used to be commit 3a6786516957d9f67af6d53a3167c88aa272972f) --- source3/lib/util.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 8f6a381944..d945bca5a7 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -277,7 +277,8 @@ const char *tmpdir(void) Add a gid to an array of gids if it's not already there. ****************************************************************************/ -void add_gid_to_array_unique(gid_t gid, gid_t **gids, int *num) +void add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid, + gid_t **gids, int *num) { int i; @@ -285,8 +286,11 @@ void add_gid_to_array_unique(gid_t gid, gid_t **gids, int *num) if ((*gids)[i] == gid) return; } - - *gids = SMB_REALLOC_ARRAY(*gids, gid_t, *num+1); + + if (mem_ctx != NULL) + *gids = TALLOC_REALLOC_ARRAY(mem_ctx, *gids, gid_t, *num+1); + else + *gids = SMB_REALLOC_ARRAY(*gids, gid_t, *num+1); if (*gids == NULL) return; -- cgit