summaryrefslogtreecommitdiff
path: root/source3/lib
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/lib
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/lib')
-rw-r--r--source3/lib/messages.c13
-rw-r--r--source3/lib/talloc.c5
2 files changed, 7 insertions, 11 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index e5aafcb646..d46ad74553 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -384,22 +384,13 @@ this is a useful function for sending messages to all smbd processes.
It isn't very efficient, but should be OK for the sorts of applications that
use it. When we need efficient broadcast we can add it.
****************************************************************************/
-BOOL message_send_all(int msg_type, void *buf, size_t len, BOOL duplicates_allowed)
+BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type, void *buf, size_t len, BOOL duplicates_allowed)
{
- TDB_CONTEXT *the_tdb;
-
- the_tdb = tdb_open(lock_path("connections.tdb"), 0, 0, O_RDONLY, 0);
- if (!the_tdb) {
- DEBUG(2,("Failed to open connections database in message_send_all\n"));
- return False;
- }
-
msg_all.msg_type = msg_type;
msg_all.buf = buf;
msg_all.len = len;
msg_all.duplicates = duplicates_allowed;
- tdb_traverse(the_tdb, traverse_fn, NULL);
- tdb_close(the_tdb);
+ tdb_traverse(conn_tdb, traverse_fn, NULL);
return True;
}
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index acc6204bed..a04bd2561b 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -96,6 +96,9 @@ void talloc_destroy_pool(TALLOC_CTX *t)
{
struct talloc_chunk *c;
+ if (!t)
+ return;
+
while (t->list) {
c = t->list->next;
free(t->list->ptr);
@@ -109,6 +112,8 @@ void talloc_destroy_pool(TALLOC_CTX *t)
/* destroy a whole pool including the context */
void talloc_destroy(TALLOC_CTX *t)
{
+ if (!t)
+ return;
talloc_destroy_pool(t);
free(t);
}