Subject: [PATCH 29/35] s3: smbd: OpenDir_fsp() - Fix memory leak on error.

From: Jeremy Allison <[email-masked]>
Date: Mon, 19 Dec 2016 12:15:59 -0800

CVE-2017-2619

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12496

Signed-off-by: Jeremy Allison <[email-masked]>
Signed-off-by: Arvid Requate <[email-masked]>
---
 source3/smbd/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5634085..a3a060b 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1742,7 +1742,7 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
 			dirp->dir_path,
 			strerror(errno)));
 		if (errno != ENOSYS) {
-			return NULL;
+			goto fail;
 		}
 	}
 
-- 
2.1.4