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 )
862
862
JOBOBJECT_BASIC_PROCESS_ID_LIST * pid_list = NULL ;
863
863
864
864
while (true) {
865
+ size_t pid_list_size = sizeof (JOBOBJECT_BASIC_PROCESS_ID_LIST ) + sizeof (ULONG_PTR ) * (process_count - 1 );
866
+
865
867
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 );
867
869
pid_list -> NumberOfAssignedProcesses = process_count ;
868
870
}
869
871
@@ -872,7 +874,7 @@ waitForJobCompletion ( HANDLE hJob )
872
874
hJob ,
873
875
JobObjectBasicProcessIdList ,
874
876
pid_list ,
875
- sizeof ( JOBOBJECT_BASIC_PROCESS_ID_LIST ) ,
877
+ pid_list_size ,
876
878
NULL );
877
879
878
880
if (!success && GetLastError () == ERROR_MORE_DATA ) {
You can’t perform that action at this time.
0 commit comments