From d8223e4b94afe04f6b2fcf1a8ee4ba2d5cf16d22 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 23 May 2006 06:19:35 +0000 Subject: r15833: fixed two delete on close memory leaks (This used to be commit f3274e8f78f28a51313e98934b208c2deb9ae9ea) --- source4/ntvfs/posix/pvfs_open.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index fd382ba1d9..2102de29f5 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -58,7 +58,7 @@ static int pvfs_dir_handle_destructor(void *p) { struct pvfs_file_handle *h = p; int open_count; - char *path; + char *path = NULL; if (h->name->stream_name == NULL && pvfs_delete_on_close_set(h->pvfs, h, &open_count, &path) && @@ -75,6 +75,8 @@ static int pvfs_dir_handle_destructor(void *p) } } + talloc_free(path); + if (h->have_opendb_entry) { struct odb_lock *lck; NTSTATUS status; @@ -414,7 +416,7 @@ static int pvfs_handle_destructor(void *p) { struct pvfs_file_handle *h = p; int open_count; - char *path; + char *path = NULL; /* the write time is no longer sticky */ if (h->sticky_write_time) { @@ -464,6 +466,8 @@ static int pvfs_handle_destructor(void *p) } } + talloc_free(path); + if (h->have_opendb_entry) { struct odb_lock *lck; NTSTATUS status; -- cgit