summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-03-23 20:43:44 +0000
committerLuke Leighton <lkcl@samba.org>1999-03-23 20:43:44 +0000
commit6b9cb3a2545226257d698406c1ab3b016464705e (patch)
treef048c42b460145a8c95bf84407522c3fdaf1a71d /source3/rpc_client
parent877db70926195076b979821270bcd473c34e7709 (diff)
downloadsamba-6b9cb3a2545226257d698406c1ab3b016464705e.tar.gz
samba-6b9cb3a2545226257d698406c1ab3b016464705e.tar.bz2
samba-6b9cb3a2545226257d698406c1ab3b016464705e.zip
dynamic memory allocation in samr enum dom users. works with 849 entries now.
(This used to be commit 103557e26b071bf1e65e025ef5a52ccdbf483d02)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_samr.c16
1 files changed, 9 insertions, 7 deletions
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 );