diff options
author | Jeremy Allison <jra@samba.org> | 2001-05-01 23:07:30 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-05-01 23:07:30 +0000 |
commit | f5eab4421c0fcda6907259cb91ba091e9cca5eae (patch) | |
tree | d091ec613c15342bd895c1d5447130bc6a6e49c8 /source3/libsmb | |
parent | 0961f7b494319e90c581016fda95be0b8eaf4229 (diff) | |
download | samba-f5eab4421c0fcda6907259cb91ba091e9cca5eae.tar.gz samba-f5eab4421c0fcda6907259cb91ba091e9cca5eae.tar.bz2 samba-f5eab4421c0fcda6907259cb91ba091e9cca5eae.zip |
Fixup smbcacls. Don't return memory already freed, don't free memory allocated
with talloc.
Jeremy.
(This used to be commit 0ae0d024f5898f7e47e4b1d4487b15447096780c)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clisecdesc.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/source3/libsmb/clisecdesc.c b/source3/libsmb/clisecdesc.c index 6824a0edf4..69c7d5f73f 100644 --- a/source3/libsmb/clisecdesc.c +++ b/source3/libsmb/clisecdesc.c @@ -28,12 +28,11 @@ /**************************************************************************** query the security descriptor for a open file ****************************************************************************/ -SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd) +SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd, TALLOC_CTX *mem_ctx) { char param[8]; char *rparam=NULL, *rdata=NULL; int rparam_count=0, rdata_count=0; - TALLOC_CTX *mem_ctx=NULL; prs_struct pd; SEC_DESC *psd = NULL; @@ -58,11 +57,6 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd) goto cleanup; } - if ((mem_ctx = talloc_init()) == NULL) { - DEBUG(0,("talloc_init failed.\n")); - goto cleanup; - } - prs_init(&pd, rdata_count, mem_ctx, UNMARSHALL); prs_append_data(&pd, rdata, rdata_count); pd.data_offset = 0; @@ -74,7 +68,6 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd) cleanup: - talloc_destroy(mem_ctx); safe_free(rparam); safe_free(rdata); @@ -82,9 +75,6 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd) return psd; } - - - /**************************************************************************** set the security descriptor for a open file ****************************************************************************/ @@ -143,4 +133,3 @@ BOOL cli_set_secdesc(struct cli_state *cli,int fd, SEC_DESC *sd) prs_mem_free(&pd); return ret; } - |