]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9984 [mod_enum] Fix for handle leak in Windows
authorChris Young <chris.young@enghouse.com>
Fri, 27 Jan 2017 10:01:42 +0000 (10:01 +0000)
committerChris Young <chris.young@enghouse.com>
Fri, 27 Jan 2017 10:01:42 +0000 (10:01 +0000)
src/mod/applications/mod_enum/mod_enum.c

index 53a81b47d4df4494afb2411de389372611f822e8..8d74ba0033d5bd0fb742fc4f83c9401bf95a32b9 100644 (file)
@@ -175,7 +175,6 @@ static switch_status_t load_config(void)
                                buf = (char*)malloc(data_sz + 1);
 
                                RegQueryValueEx(hKey, "DhcpNameServer", NULL, NULL, (LPBYTE)buf, &data_sz);
-                               RegCloseKey(hKey);
 
                                if(buf[data_sz - 1] != 0) {
                                        buf[data_sz] = 0;
@@ -183,6 +182,8 @@ static switch_status_t load_config(void)
                                switch_replace_char(buf, ' ', 0, SWITCH_FALSE); /* only use the first entry ex "192.168.1.1 192.168.1.2" */
                                globals.nameserver[0] = buf;
                        }
+                       
+                       RegCloseKey(hKey);
                }
        }
 #endif