From 326df161736abc16fb3bd35a18a3e55a44fb3c5d Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 5 Jan 2018 10:23:30 +0100 Subject: [PATCH] vfs_fileid: preserve errno in an error code path Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/modules/vfs_fileid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c index 9a8f3f99193..fedcac7e6d5 100644 --- a/source3/modules/vfs_fileid.c +++ b/source3/modules/vfs_fileid.c @@ -183,6 +183,7 @@ static int fileid_connect(struct vfs_handle_struct *handle, { struct fileid_handle_data *data; const char *algorithm; + int saved_errno; int ret = SMB_VFS_NEXT_CONNECT(handle, service, user); if (ret < 0) { @@ -191,8 +192,10 @@ static int fileid_connect(struct vfs_handle_struct *handle, data = talloc_zero(handle->conn, struct fileid_handle_data); if (!data) { + saved_errno = errno; SMB_VFS_NEXT_DISCONNECT(handle); DEBUG(0, ("talloc_zero() failed\n")); + errno = saved_errno; return -1; } -- 2.47.3