Wrong function...
[tinc] / src / mingw / device.c
index dfda089..23b4c00 100644 (file)
@@ -17,7 +17,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id: device.c,v 1.1.2.6 2003/07/29 22:59:01 guus Exp $
+    $Id: device.c,v 1.1.2.8 2003/08/01 08:18:22 guus Exp $
 */
 
 #include "system.h"
@@ -177,6 +177,8 @@ bool setup_device(void)
                len = sizeof(adaptername);
                RegQueryValueEx(key2, "Name", 0, 0, adaptername, &len);
 
+               RegCloseKey(key2);
+
                if(device) {
                        if(!strcmp(device, adapterid)) {
                                found = true;
@@ -201,6 +203,8 @@ bool setup_device(void)
                }
        }
 
+       RegCloseKey(key);
+
        if(!found) {
                logger(LOG_ERR, _("No Windows tap device found!"));
                return false;