summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-12-15 01:02:11 +0000
committerJeremy Allison <jra@samba.org>2000-12-15 01:02:11 +0000
commit369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4 (patch)
treee4237cf9927822e2b49faea870dd13012e5a5cb5 /source3/rpc_server
parent1fc3e43f9b9b431e8499d2ebd7f557b9bf2ff14c (diff)
downloadsamba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.tar.gz
samba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.tar.bz2
samba-369f5fd1d7a6e6298bc3cbe01e3aaed0106f6cf4.zip
Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open problem. Jeremy. (This used to be commit 0a40bc83e14c69a09948ec09bb6fc5026c4f4c14)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_lsa.c20
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c2
2 files changed, 2 insertions, 20 deletions
diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c
index 5bc780860f..aea7294ffe 100644
--- a/source3/rpc_server/srv_lsa.c
+++ b/source3/rpc_server/srv_lsa.c
@@ -390,11 +390,6 @@ static BOOL lsa_reply_lookup_sids(prs_struct *rdata, DOM_SID2 *sid, int num_entr
return False;
}
- /* Free memory - perhaps this should be done using talloc()? */
-
- safe_free(names.name);
- safe_free(names.uni_name);
-
return True;
}
@@ -409,11 +404,8 @@ static BOOL lsa_reply_lookup_names(prs_struct *rdata, UNISTR2 *names,
DOM_R_REF ref;
DOM_RID2 rids[MAX_LOOKUP_SIDS];
uint32 mapped_count = 0;
- TALLOC_CTX *mem_ctx = talloc_init();
BOOL result = True;
- if (!mem_ctx) return False;
-
ZERO_STRUCT(r_l);
ZERO_STRUCT(ref);
ZERO_ARRAY(rids);
@@ -423,12 +415,11 @@ static BOOL lsa_reply_lookup_names(prs_struct *rdata, UNISTR2 *names,
init_reply_lookup_names(&r_l, &ref, num_entries, rids, mapped_count);
/* store the response in the SMB stream */
- if(!lsa_io_r_lookup_names(mem_ctx, "", &r_l, rdata, 0)) {
+ if(!lsa_io_r_lookup_names("", &r_l, rdata, 0)) {
DEBUG(0,("lsa_reply_lookup_names: Failed to marshall LSA_R_LOOKUP_NAMES.\n"));
result = False;
}
- talloc_destroy(mem_ctx);
return result;
}
@@ -583,20 +574,13 @@ static BOOL api_lsa_lookup_sids(pipes_struct *p)
if(!lsa_io_q_lookup_sids("", &q_l, data, 0)) {
DEBUG(0,("api_lsa_lookup_sids: failed to unmarshall LSA_Q_LOOKUP_SIDS.\n"));
result = False;
- goto done;
}
/* construct reply. return status is always 0x0 */
if(!lsa_reply_lookup_sids(rdata, q_l.sids.sid, q_l.sids.num_entries)) {
result = False;
- goto done;
}
-
- done:
- safe_free(q_l.sids.ptr_sid);
- safe_free(q_l.sids.sid);
-
return result;
}
@@ -618,8 +602,6 @@ static BOOL api_lsa_lookup_names(pipes_struct *p)
return False;
}
- SMB_ASSERT_ARRAY(q_l.uni_name, q_l.num_entries);
-
return lsa_reply_lookup_names(rdata, q_l.uni_name, q_l.num_entries);
}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index a7614ff640..b43501a56b 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -640,7 +640,7 @@ static BOOL srv_spoolss_sendnotify(POLICY_HND *handle)
/*srv_spoolss_receive_message(printer);*/
DEBUG(10,("srv_spoolss_sendnotify: Sending message about printer %s\n", printer ));
- message_send_all(MSG_PRINTER_NOTIFY, printer, strlen(printer) + 1, False); /* Null terminate... */
+ message_send_all(conn_tdb_ctx(), MSG_PRINTER_NOTIFY, printer, strlen(printer) + 1, False); /* Null terminate... */
return True;
}