summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-11-11 08:00:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:10 -0500
commit5f58c67b8265adaeb386d718c8f7fe86807115fb (patch)
tree9ca2767d97ba441d961e4d2cba51a7f117a7625b /source4
parentd9d90e105b493cfb7676eb65af4456dfb572a5b1 (diff)
downloadsamba-5f58c67b8265adaeb386d718c8f7fe86807115fb.tar.gz
samba-5f58c67b8265adaeb386d718c8f7fe86807115fb.tar.bz2
samba-5f58c67b8265adaeb386d718c8f7fe86807115fb.zip
r11671: - make sure req is initialized
- only free the buffer when there's no request - call async callback on error metze (This used to be commit 2084d62dd54c230c6494e482cb346b3ea959e6fb)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/smb2/transport.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 97408b2ae3..9940379f98 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -145,7 +145,7 @@ static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob)
struct smb2_transport);
uint8_t *buffer, *hdr;
int len;
- struct smb2_request *req;
+ struct smb2_request *req = NULL;
uint64_t seqnum;
buffer = blob.data;
@@ -197,12 +197,16 @@ static NTSTATUS smb2_transport_finish_recv(void *private, DATA_BLOB blob)
return NT_STATUS_OK;
error:
+ dump_data(2, buffer, len);
if (req) {
DLIST_REMOVE(transport->pending_recv, req);
req->state = SMB2_REQUEST_ERROR;
+ if (req->async.fn) {
+ req->async.fn(req);
+ }
+ } else {
+ talloc_free(buffer);
}
- dump_data(2, blob.data, blob.length);
- data_blob_free(&blob);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -210,7 +214,7 @@ error:
handle timeouts of individual smb requests
*/
static void smb2_timeout_handler(struct event_context *ev, struct timed_event *te,
- struct timeval t, void *private)
+ struct timeval t, void *private)
{
struct smb2_request *req = talloc_get_type(private, struct smb2_request);