summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-07 18:16:56 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-07 19:16:28 +0200
commit3cdf962d1ea2823e2a5200533685b3a627a00237 (patch)
treef88e592dd09537e7f26e5a9234ed8bdf6941f709 /source3
parent0f006751ec22a13de898fbafcb6de5a8b8d5ec15 (diff)
downloadsamba-3cdf962d1ea2823e2a5200533685b3a627a00237.tar.gz
samba-3cdf962d1ea2823e2a5200533685b3a627a00237.tar.bz2
samba-3cdf962d1ea2823e2a5200533685b3a627a00237.zip
s3:libsmb: finally remove unused cli_state->outbuf
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/include/client.h1
-rw-r--r--source3/libsmb/cliconnect.c6
-rw-r--r--source3/libsmb/clientgen.c6
3 files changed, 2 insertions, 11 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 40040f4bdf..6486c76f83 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -95,7 +95,6 @@ struct cli_state {
int timeout; /* in milliseconds. */
size_t max_xmit;
size_t max_mux;
- char *outbuf;
char *inbuf;
unsigned int bufsize;
int initialised;
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 8c51bea9e3..8c74d2e6cc 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2700,13 +2700,9 @@ static void cli_negprot_done(struct tevent_req *subreq)
}
if (cli->capabilities & (CAP_LARGE_READX|CAP_LARGE_WRITEX)) {
- SAFE_FREE(cli->outbuf);
SAFE_FREE(cli->inbuf);
- cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+LARGE_WRITEX_HDR_SIZE+SAFETY_MARGIN);
- if (!cli->outbuf || !cli->inbuf) {
- tevent_req_nterror(req,
- NT_STATUS_NO_MEMORY);
+ if (tevent_req_nomem(cli->inbuf, req)) {
return;
}
cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE + LARGE_WRITEX_HDR_SIZE;
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index d3b66b67e1..91e7fd4b7f 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -201,7 +201,6 @@ struct cli_state *cli_initialise_ex(int signing_state)
cli->timeout = 20000; /* Timeout is in milliseconds. */
cli->bufsize = CLI_BUFFER_SIZE+4;
cli->max_xmit = cli->bufsize;
- cli->outbuf = (char *)SMB_MALLOC(cli->bufsize+SAFETY_MARGIN);
cli->inbuf = (char *)SMB_MALLOC(cli->bufsize+SAFETY_MARGIN);
cli->oplock_handler = cli_oplock_ack;
cli->case_sensitive = false;
@@ -238,10 +237,9 @@ struct cli_state *cli_initialise_ex(int signing_state)
mandatory_signing = true;
}
- if (!cli->outbuf || !cli->inbuf)
+ if (!cli->inbuf)
goto error;
- memset(cli->outbuf, 0, cli->bufsize);
memset(cli->inbuf, 0, cli->bufsize);
/* initialise signing */
@@ -267,7 +265,6 @@ struct cli_state *cli_initialise_ex(int signing_state)
error:
SAFE_FREE(cli->inbuf);
- SAFE_FREE(cli->outbuf);
TALLOC_FREE(cli);
return NULL;
}
@@ -315,7 +312,6 @@ static void _cli_shutdown(struct cli_state *cli)
cli_tdis(cli);
}
- SAFE_FREE(cli->outbuf);
SAFE_FREE(cli->inbuf);
data_blob_free(&cli->secblob);