[ros-diffs] [weiden] 18390: don't try to free the ansi strings passed by the caller

weiden at svn.reactos.com weiden at svn.reactos.com
Mon Oct 10 00:35:55 CEST 2005


don't try to free the ansi strings passed by the caller
Modified: trunk/reactos/lib/advapi32/misc/shutdown.c
  _____  

Modified: trunk/reactos/lib/advapi32/misc/shutdown.c
--- trunk/reactos/lib/advapi32/misc/shutdown.c	2005-10-09 22:33:26 UTC
(rev 18389)
+++ trunk/reactos/lib/advapi32/misc/shutdown.c	2005-10-09 22:35:41 UTC
(rev 18390)
@@ -48,7 +48,6 @@

             return FALSE;
     }
     rv = AbortSystemShutdownW(MachineNameW.Buffer);
-    RtlFreeAnsiString(&MachineNameA);
     RtlFreeUnicodeString(&MachineNameW);
     SetLastError(ERROR_SUCCESS);
     return rv;
@@ -110,7 +109,6 @@
         RtlInitAnsiString(&MachineNameA, lpMachineName);
         Status = RtlAnsiStringToUnicodeString(&MachineNameW,
&MachineNameA, TRUE);
         if (STATUS_SUCCESS != Status) {
-            RtlFreeAnsiString(&MachineNameA);
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
@@ -120,10 +118,8 @@
         Status = RtlAnsiStringToUnicodeString(&MessageW, &MessageA,
TRUE);
         if (STATUS_SUCCESS != Status) {
             if (MachineNameW.Length) {
-                RtlFreeAnsiString(&MachineNameA);
                 RtlFreeUnicodeString(&MachineNameW);
             }
-            RtlFreeAnsiString(&MessageA);
             SetLastError(RtlNtStatusToDosError(Status));
             return FALSE;
         }
@@ -136,11 +132,9 @@
             bRebootAfterShutdown);
     LastError = GetLastError();
     if (lpMachineName) {
-        RtlFreeAnsiString(&MachineNameA);
         RtlFreeUnicodeString(&MachineNameW);
     }
     if (lpMessage) {
-        RtlFreeAnsiString(&MessageA);
         RtlFreeUnicodeString(&MessageW);
     }
     SetLastError(LastError);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051010/9a02627a/attachment.html


More information about the Ros-diffs mailing list