diff options
author | Michael Adam <obnox@samba.org> | 2007-09-19 11:01:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:51 -0500 |
commit | 5bf76929976f17aeca7853767ce4f8359acc3166 (patch) | |
tree | 9ab3415e24b65d73b22c21ac518bfa7ecbf7c8f5 /source3 | |
parent | 3d5f029ead8ccea45a5537a51f24c5144102a29b (diff) | |
download | samba-5bf76929976f17aeca7853767ce4f8359acc3166.tar.gz samba-5bf76929976f17aeca7853767ce4f8359acc3166.tar.bz2 samba-5bf76929976f17aeca7853767ce4f8359acc3166.zip |
r25223: Fix behaviour of rpccli_lsa_lookupsids_all() when
rpccli_lsa_lookupsids_noalloc() returns an error for one hunk
of SIDs: free all allocated arrays and return the error code
returned by the hunk lookup.
Michael
(This used to be commit 2c68ebd6934206186dc6e635401f66c2fd1e1234)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 281fe85576..1f0677ee03 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -259,19 +259,19 @@ NTSTATUS rpccli_lsa_lookup_sids_all(struct rpc_pipe_client *cli, if (!((*domains) = TALLOC_ARRAY(mem_ctx, char *, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids_all(): out of memory\n")); result = NT_STATUS_NO_MEMORY; - goto done; + goto fail; } if (!((*names) = TALLOC_ARRAY(mem_ctx, char *, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids_all(): out of memory\n")); result = NT_STATUS_NO_MEMORY; - goto done; + goto fail; } if (!((*types) = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_sids))) { DEBUG(0, ("rpccli_lsa_lookup_sids_all(): out of memory\n")); result = NT_STATUS_NO_MEMORY; - goto done; + goto fail; } } else { (*domains) = NULL; @@ -312,7 +312,8 @@ NTSTATUS rpccli_lsa_lookup_sids_all(struct rpc_pipe_client *cli, !NT_STATUS_EQUAL(hunk_result, NT_STATUS_NONE_MAPPED)) { /* An actual error occured */ - goto done; + result = hunk_result; + goto fail; } /* adapt overall result */ @@ -333,7 +334,12 @@ NTSTATUS rpccli_lsa_lookup_sids_all(struct rpc_pipe_client *cli, hunk_types += hunk_num_sids; } -done: + return result; + +fail: + TALLOC_FREE(*domains); + TALLOC_FREE(*names); + TALLOC_FREE(*types); return result; } |