mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s3 perfcount: Fix segfault with smbclient 'echo 3 foo'
This commit is contained in:
parent
6bd7e2b097
commit
57a31ef203
@ -227,11 +227,8 @@ static void perfcount_test_add(struct smb_perfcount_data *pcd)
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
struct perfcount_test_counter *ctr;
|
||||
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_add - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctr = SMB_MALLOC_P(struct perfcount_test_counter);
|
||||
if (!ctr) {
|
||||
@ -247,11 +244,8 @@ static void perfcount_test_set_op(struct smb_perfcount_data *pcd, int op)
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_op - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctxt->ops->op = op;
|
||||
}
|
||||
@ -261,11 +255,8 @@ static void perfcount_test_set_subop(struct smb_perfcount_data *pcd, int sub_op)
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_sub_op - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctxt->ops->sub_op = sub_op;
|
||||
}
|
||||
@ -274,11 +265,9 @@ static void perfcount_test_set_ioctl(struct smb_perfcount_data *pcd, int io_ctl)
|
||||
{
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_ioctl - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctxt->ops->ioctl = io_ctl;
|
||||
}
|
||||
|
||||
@ -287,11 +276,9 @@ static void perfcount_test_set_msglen_in(struct smb_perfcount_data *pcd,
|
||||
{
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_msglen_in - "
|
||||
"uninitialized perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctxt->ops->bytes_in = bytes_in;
|
||||
}
|
||||
|
||||
@ -301,11 +288,8 @@ static void perfcount_test_set_msglen_out(struct smb_perfcount_data *pcd,
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_msglen_out - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
ctxt->ops->bytes_out = bytes_out;
|
||||
}
|
||||
@ -318,11 +302,7 @@ static void perfcount_test_defer_op(struct smb_perfcount_data *pcd,
|
||||
struct smb_perfcount_data *def_pcd)
|
||||
{
|
||||
/* we don't do anything special to deferred ops */
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_set_msglen_out - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void perfcount_test_set_client(struct smb_perfcount_data *pcd,
|
||||
@ -337,15 +317,13 @@ static void perfcount_test_end(struct smb_perfcount_data *pcd)
|
||||
{
|
||||
struct perfcount_test_context *ctxt =
|
||||
(struct perfcount_test_context *)pcd->context;
|
||||
if (pcd->context == NULL) {
|
||||
DEBUG(0,("perfcount_test_end - uninitialized "
|
||||
"perfcount context - %p\n", pcd));
|
||||
if (pcd->context == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
/* @bug - we don't store outbytes right for chained cmds */
|
||||
perfcount_test_add_counters(ctxt);
|
||||
perfcount_test_dump_counters();
|
||||
pcd->context = NULL;
|
||||
SAFE_FREE(ctxt);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user