Windows: remove unused and leaked uniRootFileNameClone
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 16 May 2013 10:47:13 +0000 (06:47 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 16 May 2013 17:29:49 +0000 (10:29 -0700)
In AFSCommonCreate remove the allocated but never used but leaked
'uniRootFileNameClone' Unicode string.

Change-Id: I02a4a1a2383c5a85f2a939b4d18e38def4cf2687
Reviewed-on: http://gerrit.openafs.org/9920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/common/AFSRedirCommonDefines.h
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp

index bdd1740..dc66eb0 100644 (file)
@@ -91,7 +91,7 @@
 #define AFS_NAME_BUFFER_EIGHT_TAG    '8NFA'
 #define AFS_NAME_BUFFER_NINE_TAG     '9NFA'
 #define AFS_NAME_BUFFER_TEN_TAG      'ANFA'
-#define AFS_NAME_BUFFER_ELEVEN_TAG   'BNFA'
+#define AFS_NAME_BUFFER_ELEVEN_TAG   'BNFA'     // Unused
 #define AFS_SUBST_BUFFER_TAG         'SBFA'
 #define AFS_FILE_CREATE_BUFFER_TAG   'CFFA'
 #define AFS_RENAME_REQUEST_TAG       'RFFA'
index f12cc0c..648ad29 100644 (file)
@@ -629,7 +629,6 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
            else
             {
                AFSNameArrayHdr    *pNameArrayClone = NULL;
-               UNICODE_STRING      uniRootFileNameClone;
 
                //
                // The FILE_OPEN_REPARSE_POINT flag has been specified and a ReparsePointPolicy
@@ -681,29 +680,6 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
                    try_return( ntStatus);
                }
 
-               uniRootFileNameClone = uniRootFileName;
-
-               uniRootFileNameClone.Buffer = (WCHAR *)AFSExAllocatePoolWithTag( PagedPool,
-                                                                                uniRootFileNameClone.MaximumLength,
-                                                                                AFS_NAME_BUFFER_ELEVEN_TAG);
-
-               if( uniRootFileNameClone.Buffer == NULL)
-               {
-
-                   AFSFreeNameArray( pNameArrayClone);
-
-                   AFSDbgTrace(( AFS_SUBSYSTEM_FILE_PROCESSING,
-                                 AFS_TRACE_LEVEL_ERROR,
-                                 "AFSCommonCreate (%p) Failed to allocate uniRootFileNameClone\n",
-                                 Irp));
-
-                   try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
-               }
-
-               RtlCopyMemory( uniRootFileNameClone.Buffer,
-                              uniRootFileName.Buffer,
-                              uniRootFileNameClone.Length);
-
                 //
                // Now that the data is saved perform the lookup to determine
                // what the target resolves to.
@@ -749,12 +725,6 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
 
                        pNameArrayClone = NULL;
 
-                       AFSExFreePoolWithTag( uniRootFileNameClone.Buffer,
-                                             AFS_NAME_BUFFER_ELEVEN_TAG);
-
-                       RtlZeroMemory( &uniRootFileNameClone,
-                                      sizeof( UNICODE_STRING));
-
                        ClearFlag( ulOptions, FILE_OPEN_REPARSE_POINT);
                    }
                    else