r15833: fixed two delete on close memory leaks
authorAndrew Tridgell <tridge@samba.org>
Tue, 23 May 2006 06:19:35 +0000 (06:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:08:30 +0000 (14:08 -0500)
(This used to be commit f3274e8f78f28a51313e98934b208c2deb9ae9ea)

source4/ntvfs/posix/pvfs_open.c

index fd382ba1d93f24bbd2e9e50b2b44dcdf57fd00f0..2102de29f5303bc035acf73eb50ad42ac04c8a6d 100644 (file)
@@ -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;