summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_readahead.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules/vfs_readahead.c')
-rw-r--r--source3/modules/vfs_readahead.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c
index 124230811d..e7a7dd305c 100644
--- a/source3/modules/vfs_readahead.c
+++ b/source3/modules/vfs_readahead.c
@@ -127,8 +127,15 @@ static int readahead_connect(struct vfs_handle_struct *handle,
const char *service,
const char *user)
{
- struct readahead_data *rhd = SMB_MALLOC_P(struct readahead_data);
+ struct readahead_data *rhd;
+ int ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
+
+ if (ret < 0) {
+ return ret;
+ }
+ rhd = SMB_MALLOC_P(struct readahead_data);
if (!rhd) {
+ SMB_VFS_NEXT_DISCONNECT(handle);
DEBUG(0,("readahead_connect: out of memory\n"));
return -1;
}
@@ -152,7 +159,7 @@ static int readahead_connect(struct vfs_handle_struct *handle,
handle->data = (void *)rhd;
handle->free_data = free_readahead_data;
- return SMB_VFS_NEXT_CONNECT(handle, service, user);
+ return 0;
}
static struct vfs_fn_pointers vfs_readahead_fns = {