Skip to content

Commit

Permalink
Zero memory and set size
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Oct 19, 2022
1 parent bd2d43d commit 14d24d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ psutil_proc_memory_uss(PyObject *self, PyObject *args) {
static PyObject *
psutil_virtual_mem(PyObject *self, PyObject *args) {
PERFORMANCE_INFORMATION perfInfo;
ZeroMemory(&perfInfo, sizeof(PERFORMANCE_INFORMATION));
perfInfo.cb = sizeof(PERFORMANCE_INFORMATION);
if (! GetPerformanceInfo(&perfInfo, sizeof(PERFORMANCE_INFORMATION))) {
PyErr_SetFromWindowsErr(0);
return NULL;
Expand Down

0 comments on commit 14d24d7

Please sign in to comment.