The branch, master has been updated
       via  8365318 leases_db: don't leak lock_path onto talloc tos
      from  26809d1 smbd: Fix a small leak on talloc_tos()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8365318b6d5df5db3f47ee496b3cf5ce83252572
Author: David Disseldorp <[email protected]>
Date:   Mon Jan 12 16:49:54 2015 +0100

    leases_db: don't leak lock_path onto talloc tos
    
    Also check for allocation failures.
    
    Signed-off-by: David Disseldorp <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Mon Jan 12 19:22:31 CET 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/locking/leases_db.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/locking/leases_db.c b/source3/locking/leases_db.c
index 2ee6a26..4167ef7 100644
--- a/source3/locking/leases_db.c
+++ b/source3/locking/leases_db.c
@@ -35,16 +35,23 @@ static struct db_context *leases_db;
 
 bool leases_db_init(bool read_only)
 {
+       char *db_path;
+
        if (leases_db) {
                return true;
        }
 
-       leases_db = db_open(NULL, lock_path("leases.tdb"), 0,
+       db_path = lock_path("leases.tdb");
+       if (db_path == NULL) {
+               return false;
+       }
+
+       leases_db = db_open(NULL, db_path, 0,
                            TDB_DEFAULT|TDB_VOLATILE|TDB_CLEAR_IF_FIRST|
                            TDB_INCOMPATIBLE_HASH,
                            read_only ? O_RDONLY : O_RDWR|O_CREAT, 0644,
                            DBWRAP_LOCK_ORDER_2, DBWRAP_FLAG_NONE);
-
+       TALLOC_FREE(db_path);
        if (leases_db == NULL) {
                DEBUG(1, ("ERROR: Failed to initialise leases database\n"));
                return false;


-- 
Samba Shared Repository

Reply via email to