fix memory leak in case of error
authorChristoph von Wittich <christoph_vw@reactos.org>
Wed, 16 Nov 2005 15:53:16 +0000 (15:53 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Wed, 16 Nov 2005 15:53:16 +0000 (15:53 +0000)
svn path=/trunk/; revision=19266

reactos/lib/newdev/newdev.c

index 4b19d24..bd6ece0 100644 (file)
@@ -66,6 +66,7 @@ UpdateDriverForPlugAndPlayDevicesA(
     FullInfPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
     if (!FullInfPathW)
     {
     FullInfPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
     if (!FullInfPathW)
     {
+        HeapFree(GetProcessHeap(), 0, HardwareIdW);
         SetLastError(ERROR_GEN_FAILURE);
         return FALSE;
     }
         SetLastError(ERROR_GEN_FAILURE);
         return FALSE;
     }