diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-20 05:16:07 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-20 05:16:07 +0200 |
commit | 8184b83896e8835661f0d71304422d786df51f8d (patch) | |
tree | 56e80c87ca97d6d3542361a1c3e5bece9770f8eb | |
parent | 51f7849e2816767792d4096a111b59e787e5542b (diff) | |
download | psutil-win-openprocess-fix-2.tar.gz |
fix memleakwin-openprocess-fix-2
-rw-r--r-- | psutil/arch/windows/process_info.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/psutil/arch/windows/process_info.c b/psutil/arch/windows/process_info.c index e1c58b29..cc566952 100644 --- a/psutil/arch/windows/process_info.c +++ b/psutil/arch/windows/process_info.c @@ -180,9 +180,12 @@ psutil_pid_in_pids(DWORD pid) { if (proclist == NULL) return -1; for (i = 0; i < numberOfReturnedPIDs; i++) { - if (proclist[i] == pid) + if (proclist[i] == pid) { + free(proclist); return 1; + } } + free(proclist); return 0; } |