[ros-diffs] [weiden] 18086: - fixed uninitialized variable warning

weiden at svn.reactos.com weiden at svn.reactos.com
Mon Sep 26 13:14:49 CEST 2005


- fixed uninitialized variable warning
- fixed memory leak in SetupDiBuildDriverInfoList()
Modified: trunk/reactos/lib/setupapi/devinst.c
  _____  

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-09-26 11:11:48 UTC
(rev 18085)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-09-26 11:14:34 UTC
(rev 18086)
@@ -3454,7 +3454,9 @@

             &RequiredSize);
     }
     //FIXME: DriverDate = Version.DriverVer => invalid date = 00/00/00
+    RtlZeroMemory(DriverDate, sizeof(FILETIME));
     //FIXME: DriverVersion = Version.DriverVer => invalid = 0
+    *DriverVersion = 0;
 
     *pProviderName = ProviderName;
     return TRUE;
@@ -3613,9 +3615,7 @@
                     /* Check if the ClassGuid in this .inf file is
corresponding with our needs */
                     if (!IsEqualIID(&list->ClassGuid, &GUID_NULL) &&
!IsEqualIID(&list->ClassGuid, &ClassGuid))
                     {
-                        SetupCloseInfFile(hInf);
-                        hInf = INVALID_HANDLE_VALUE;
-                        continue;
+                        goto next;
                     }
                 }
 
@@ -3766,9 +3766,11 @@
                     ManufacturerName = ManufacturerSection = NULL;
                     Result = SetupFindNextLine(&ContextManufacturer,
&ContextManufacturer);
                 }
+
+                ret = TRUE;
+next:
                 HeapFree(GetProcessHeap(), 0, ProviderName);
                 ProviderName = NULL;
-                ret = TRUE;
 
                 SetupCloseInfFile(hInf);
                 hInf = INVALID_HANDLE_VALUE;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050926/fb422103/attachment.html


More information about the Ros-diffs mailing list