Error code paths were not freeing up some memory.
Jeremy.
DEBUG(1, ("Failed to modify entry.\n"));
unbecome_root();
}
+ data_blob_free(&user_sess_key);
+ data_blob_free(&lm_sess_key);
pdb_free_sam(&sampass);
return nt_status;
}
if (!NT_STATUS_IS_OK(nt_status)) {
pdb_free_sam(&sampass);
+ data_blob_free(&user_sess_key);
+ data_blob_free(&lm_sess_key);
return nt_status;
}
if (!NT_STATUS_IS_OK(nt_status = make_server_info_sam(server_info, sampass))) {
DEBUG(0,("check_sam_security: make_server_info_sam() failed with '%s'\n", nt_errstr(nt_status)));
+ data_blob_free(&user_sess_key);
+ data_blob_free(&lm_sess_key);
return nt_status;
}
static void NTLMSSPcalc_p( pipes_struct *p, unsigned char *data, int len)
{
- unsigned char *hash = p->ntlmssp_hash;
- unsigned char index_i = hash[256];
- unsigned char index_j = hash[257];
- int ind;
+ unsigned char *hash = p->ntlmssp_hash;
+ unsigned char index_i = hash[256];
+ unsigned char index_j = hash[257];
+ int ind;
- for( ind = 0; ind < len; ind++) {
- unsigned char tc;
- unsigned char t;
+ for( ind = 0; ind < len; ind++) {
+ unsigned char tc;
+ unsigned char t;
- index_i++;
- index_j += hash[index_i];
+ index_i++;
+ index_j += hash[index_i];
- tc = hash[index_i];
- hash[index_i] = hash[index_j];
- hash[index_j] = tc;
+ tc = hash[index_i];
+ hash[index_i] = hash[index_j];
+ hash[index_j] = tc;
- t = hash[index_i] + hash[index_j];
- data[ind] = data[ind] ^ hash[t];
- }
+ t = hash[index_i] + hash[index_j];
+ data[ind] = data[ind] ^ hash[t];
+ }
- hash[256] = index_i;
- hash[257] = index_j;
+ hash[256] = index_i;
+ hash[257] = index_j;
}
/*******************************************************************
return True;
}
+/****************************************************************************
+ Close all pipes on a connection.
+****************************************************************************/
+
+void pipe_close_conn(connection_struct *conn)
+{
+ smb_np_struct *p, *next;
+
+ for (p=Pipes;p;p=next) {
+ next = p->next;
+ if (p->conn == conn) {
+ close_rpc_pipe_hnd(p);
+ }
+ }
+}
+
/****************************************************************************
Close an rpc pipe.
****************************************************************************/
{
DirCacheFlush(SNUM(conn));
- file_close_conn(conn);
- dptr_closecnum(conn);
+ if (IS_IPC(conn)) {
+ pipe_close_conn(conn);
+ } else {
+ file_close_conn(conn);
+ dptr_closecnum(conn);
+ }
change_to_root_user();