]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2017-2619: s3: smbd: Move the reference counting and destructor setup to just...
authorJeremy Allison <jra@samba.org>
Mon, 19 Dec 2016 20:32:07 +0000 (12:32 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 22 Mar 2017 09:45:16 +0000 (10:45 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12496

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/smbd/dir.c

index b8034be1557580f755fd1bbf6d4799fbe5dbc8ac..6b62f1415cfca7e6ec768e00936518f54041998f 100644 (file)
@@ -1728,11 +1728,6 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
                goto fail;
        }
 
-       if (sconn && !sconn->using_smb2) {
-               sconn->searches.dirhandles_open++;
-       }
-       talloc_set_destructor(dirp, smb_Dir_destructor);
-
        dirp->dir = SMB_VFS_FDOPENDIR(fsp, mask, attr);
        if (dirp->dir != NULL) {
                dirp->fsp = fsp;
@@ -1757,6 +1752,11 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
                goto fail;
        }
 
+       if (sconn && !sconn->using_smb2) {
+               sconn->searches.dirhandles_open++;
+       }
+       talloc_set_destructor(dirp, smb_Dir_destructor);
+
        return dirp;
 
   fail: