no need to FreeLibrary handle returned by GetModuleHandle

This commit is contained in:
Doug MacEachern committed 2007-03-08 01:59:08 +00:00
1 parent 1affc51534
commit 171f2e021e
1 file changed
+4 -2
+4 -2
View File
@@ -1354,6 +1354,10 @@ static int sigar_remote_proc_env_get(sigar_t *sigar, sigar_pid_t pid,
LPVOID addr;
int status;
/*
* Do not FreeLibrary(kdll), see:
* http://msdn2.microsoft.com/en-us/library/ms683199.aspx
*/
if (!(kdll = GetModuleHandle("msvcrt.dll"))) {
return GetLastError();
}
@@ -1370,8 +1374,6 @@ static int sigar_remote_proc_env_get(sigar_t *sigar, sigar_pid_t pid,
return GetLastError();
}
/* FIXME: close the kdll handles */
if (!(proc = OpenProcess(MAXIMUM_ALLOWED, 0, (DWORD)pid))) {
return GetLastError();
}