File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -862,8 +862,10 @@ waitForJobCompletion ( HANDLE hJob )
862862 JOBOBJECT_BASIC_PROCESS_ID_LIST * pid_list = NULL ;
863863
864864 while (true) {
865+ size_t pid_list_size = sizeof (JOBOBJECT_BASIC_PROCESS_ID_LIST ) + sizeof (ULONG_PTR ) * (process_count - 1 );
866+
865867 if (pid_list == NULL ) {
866- pid_list = malloc (sizeof ( JOBOBJECT_BASIC_PROCESS_ID_LIST ) + sizeof ( ULONG_PTR ) * process_count );
868+ pid_list = malloc (pid_list_size );
867869 pid_list -> NumberOfAssignedProcesses = process_count ;
868870 }
869871
@@ -872,7 +874,7 @@ waitForJobCompletion ( HANDLE hJob )
872874 hJob ,
873875 JobObjectBasicProcessIdList ,
874876 pid_list ,
875- sizeof ( JOBOBJECT_BASIC_PROCESS_ID_LIST ) ,
877+ pid_list_size ,
876878 NULL );
877879
878880 if (!success && GetLastError () == ERROR_MORE_DATA ) {
You can’t perform that action at this time.
0 commit comments