Skip to content

Commit

Permalink
fix memleak
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 20, 2017
1 parent 51f7849 commit 8184b83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion psutil/arch/windows/process_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8184b83

Please sign in to comment.