Zebediah Figura : setupapi: Avoid leaking subKey in SETUPDI_AddDeviceInterfaces().

Alexandre Julliard julliard at winehq.org
Thu Apr 21 15:21:38 CDT 2022


Module: wine
Branch: master
Commit: 93d8a86ce22c0295219cd709eecdee871c37f4b8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=93d8a86ce22c0295219cd709eecdee871c37f4b8

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Apr 20 16:18:20 2022 -0500

setupapi: Avoid leaking subKey in SETUPDI_AddDeviceInterfaces().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/devinst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 77fa26726cc..73e721753aa 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -2281,8 +2281,8 @@ static void SETUPDI_AddDeviceInterfaces(struct device *device, HKEY key,
                                 (BYTE *)symbolicLink, &len);
                         if (!l && dataType == REG_SZ)
                             SETUPDI_SetInterfaceSymbolicLink(iface, symbolicLink);
-                        RegCloseKey(subKey);
                     }
+                    RegCloseKey(subKey);
                 }
             }
             /* Allow enumeration to continue */




More information about the wine-cvs mailing list