source3/modules/vfs_xattr_tdb.c: fix stackframe leak
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:33:31 +0000 (05:03 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 17 Jul 2012 19:33:31 +0000 (05:03 +0930)
xattr_tdb_getxattr() doesn't free its stackframe.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
source3/modules/vfs_xattr_tdb.c

index 859e06b8606cecb61a0adbaca007230fd02fc3b6..0352539e8c17d5eea08331da9897603325756b11 100644 (file)
@@ -38,7 +38,8 @@ static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
        DATA_BLOB blob;
        TALLOC_CTX *frame = talloc_stackframe();
 
-       SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
+       SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
+                               TALLOC_FREE(frame); return -1);
 
        if (vfs_stat_smb_fname(handle->conn, path, &sbuf) == -1) {
                TALLOC_FREE(frame);
@@ -58,6 +59,7 @@ static ssize_t xattr_tdb_getxattr(struct vfs_handle_struct *handle,
                return -1;
        }
        memcpy(value, blob.data, xattr_size);
+       TALLOC_FREE(frame);
        return xattr_size;
 }