From 6b9cb3a2545226257d698406c1ab3b016464705e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 23 Mar 1999 20:43:44 +0000 Subject: dynamic memory allocation in samr enum dom users. works with 849 entries now. (This used to be commit 103557e26b071bf1e65e025ef5a52ccdbf483d02) --- source3/rpc_client/cli_samr.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source3/rpc_client') diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index f822937cef..49db8c8216 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -769,13 +769,6 @@ BOOL samr_enum_dom_users(struct cli_state *cli, uint16 fnum, int name_idx = 0; *num_sam_users = r_e.num_entries2; - if (*num_sam_users > MAX_SAM_ENTRIES) - { - *num_sam_users = MAX_SAM_ENTRIES; - DEBUG(2,("samr_enum_dom_users: sam user entries limited to %d\n", - *num_sam_users)); - } - *sam = (struct acct_info*) malloc(sizeof(struct acct_info) * (*num_sam_users)); if ((*sam) == NULL) @@ -798,6 +791,15 @@ BOOL samr_enum_dom_users(struct cli_state *cli, uint16 fnum, } valid_pol = True; } + + if (r_e.sam != NULL) + { + free(r_e.sam); + } + if (r_e.uni_acct_name != NULL) + { + free(r_e.uni_acct_name); + } } prs_mem_free(&data ); -- cgit