summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-03-27 16:33:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:20 -0500
commite84ead0cfdc5e45a577387cc54dceb4c3f32948a (patch)
tree98d8898697479b516a36e534d3b3c9e3ce8e76c7 /source3/lib/util.c
parent0aa89db9471330fd02db395c2eb387ac2dfef54f (diff)
downloadsamba-e84ead0cfdc5e45a577387cc54dceb4c3f32948a.tar.gz
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)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8f6a3819442..d945bca5a73 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;