close the snapshot handle

This commit is contained in:
Doug MacEachern 2005-05-13 20:05:37 +00:00
parent fade72859d
commit 48097a4bb4
1 changed files with 2 additions and 0 deletions

View File

@ -1317,6 +1317,7 @@ static int sigar_proc_modules_get_toolhelp(sigar_t *sigar,
module.dwSize = sizeof(MODULEENTRY32);
if (!module_first(snap_shot, &module)) {
CloseHandle(snap_shot);
return SIGAR_OK;
}
@ -1334,6 +1335,7 @@ static int sigar_proc_modules_get_toolhelp(sigar_t *sigar,
module.dwSize = sizeof(MODULEENTRY32);
} while (module_next(snap_shot, &module));
CloseHandle(snap_shot);
FreeLibrary(k32_handle);
return SIGAR_OK;