diff options
Diffstat (limited to 'source/rpc_server/srv_lsa_hnd.c')
-rw-r--r-- | source/rpc_server/srv_lsa_hnd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/rpc_server/srv_lsa_hnd.c b/source/rpc_server/srv_lsa_hnd.c index 393f50a498e..5504e4cf9c1 100644 --- a/source/rpc_server/srv_lsa_hnd.c +++ b/source/rpc_server/srv_lsa_hnd.c @@ -23,8 +23,6 @@ #include "includes.h" -extern int DEBUGLEVEL; - /* This is the max handles across all instances of a pipe name. */ #ifndef MAX_OPEN_POLS #define MAX_OPEN_POLS 1024 @@ -112,15 +110,16 @@ BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *) pol->data_ptr = data_ptr; pol->free_fn = free_fn; - pol_hnd_low++; - if (pol_hnd_low == 0) (pol_hnd_high)++; + pol_hnd_low++; + if (pol_hnd_low == 0) + (pol_hnd_high)++; - SIVAL(&pol->pol_hnd.data1, 0 , 0); /* first bit must be null */ - SIVAL(&pol->pol_hnd.data2, 0 , pol_hnd_low ); /* second bit is incrementing */ - SSVAL(&pol->pol_hnd.data3, 0 , pol_hnd_high); /* second bit is incrementing */ - SSVAL(&pol->pol_hnd.data4, 0 , (pol_hnd_high>>16)); /* second bit is incrementing */ - SIVAL(pol->pol_hnd.data5, 0, time(NULL)); /* something random */ - SIVAL(pol->pol_hnd.data5, 4, sys_getpid()); /* something more random */ + SIVAL(&pol->pol_hnd.data1, 0 , 0); /* first bit must be null */ + SIVAL(&pol->pol_hnd.data2, 0 , pol_hnd_low ); /* second bit is incrementing */ + SSVAL(&pol->pol_hnd.data3, 0 , pol_hnd_high); /* second bit is incrementing */ + SSVAL(&pol->pol_hnd.data4, 0 , (pol_hnd_high>>16)); /* second bit is incrementing */ + SIVAL(pol->pol_hnd.data5, 0, time(NULL)); /* something random */ + SIVAL(pol->pol_hnd.data5, 4, sys_getpid()); /* something more random */ DLIST_ADD(p->pipe_handles->Policy, pol); p->pipe_handles->count++; @@ -158,6 +157,7 @@ static struct policy *find_policy_by_hnd_internal(pipes_struct *p, POLICY_HND *h DEBUG(4,("Policy not found: ")); dump_data(4, (char *)hnd, sizeof(*hnd)); + p->bad_handle_fault_state = True; return NULL; } @@ -194,7 +194,7 @@ BOOL close_policy_hnd(pipes_struct *p, POLICY_HND *hnd) ZERO_STRUCTP(pol); - free(pol); + SAFE_FREE(pol); return True; } @@ -217,7 +217,7 @@ void close_policy_by_pipe(pipes_struct *p) p->pipe_handles->Policy = NULL; p->pipe_handles->count = 0; - free(p->pipe_handles); + SAFE_FREE(p->pipe_handles); p->pipe_handles = NULL; DEBUG(10,("close_policy_by_pipe: deleted handle list for pipe %s\n", p->name )); } |