Skip to content

Commit 7cc7923

Browse files
committed
Windows / cmdline(): be more defensive in free()ing in case of error
1 parent d7ce072 commit 7cc7923

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

psutil/arch/windows/proc_info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ psutil_cmdline_query_proc(DWORD pid, WCHAR **pdata, SIZE_T *psize) {
533533
error:
534534
if (buffer != NULL)
535535
free(buffer);
536+
if (bufWchar != NULL)
537+
free(bufWchar);
536538
if (hProcess != NULL)
537539
CloseHandle(hProcess);
538540
return -1;

0 commit comments

Comments
 (0)