r17041: Trying to track down a *big* memory leak in the new lock code.
authorJeremy Allison <jra@samba.org>
Fri, 14 Jul 2006 23:23:39 +0000 (23:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:19:21 +0000 (11:19 -0500)
Fix a small one first.... (easy to valgrind).
Jeremy
(This used to be commit 43d24fbd41ed745a5b21514b526e655663c509ee)

source3/locking/brlock.c
source3/locking/posix.c

index e99d4ab900b4df72d25803f7a8d4473d0bfe5699..376c2e30ba01ba604d6a837bea334d83f3747f03 100644 (file)
@@ -1259,7 +1259,7 @@ void brl_close_fnum(struct byte_range_lock *br_lck)
                        /* Copy the current lock array. */
                        locks_copy = TALLOC_MEMDUP(br_lck, locks, br_lck->num_locks * sizeof(struct lock_struct));
                        if (!locks_copy) {
-                               DEBUG(0,("brl_close_fnum: talloc fail.\n"));
+                               smb_panic("brl_close_fnum: talloc fail.\n");
                        }
 
                        for (i=0; i < br_lck->num_locks; i++) {
index 9a50f55c09787c8f19d14c848a2c384207cb9635..586de5745befcb536a81578041092b7b8d6aba00 100644 (file)
@@ -539,6 +539,7 @@ static int get_windows_lock_ref_count(files_struct *fsp)
        } else {
                memcpy(&lock_ref_count, dbuf.dptr, sizeof(int));
        }
+       SAFE_FREE(dbuf.dptr);
 
        DEBUG(10,("get_windows_lock_count for file %s = %d\n",
                fsp->fsp_name, lock_ref_count ));