提交 3e7fe833 authored 作者: Chris Young's avatar Chris Young 提交者: Mike Jerris

FS-9984 [mod_enum] Fix for handle leak in Windows

上级 ca6312ee
...@@ -175,7 +175,6 @@ static switch_status_t load_config(void) ...@@ -175,7 +175,6 @@ static switch_status_t load_config(void)
buf = (char*)malloc(data_sz + 1); buf = (char*)malloc(data_sz + 1);
RegQueryValueEx(hKey, "DhcpNameServer", NULL, NULL, (LPBYTE)buf, &data_sz); RegQueryValueEx(hKey, "DhcpNameServer", NULL, NULL, (LPBYTE)buf, &data_sz);
RegCloseKey(hKey);
if(buf[data_sz - 1] != 0) { if(buf[data_sz - 1] != 0) {
buf[data_sz] = 0; buf[data_sz] = 0;
...@@ -183,6 +182,8 @@ static switch_status_t load_config(void) ...@@ -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" */ 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; globals.nameserver[0] = buf;
} }
RegCloseKey(hKey);
} }
} }
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论