diff --git a/allocate.c b/allocate.c
index 17748f26c25692593ca83488548bf178bd1a402c..2a4fbcf8d64d5f841aa0737f5cf3e53bcb411bab 100644
--- a/allocate.c
+++ b/allocate.c
@@ -549,6 +549,7 @@ process *getNextProcessB(FILE *f, llist *arrivals, process *readAhead) {
             //llist_print();
             while (readAhead->timeArrived != -1 && !batchEnd) {
                 if (fgets(line, sizeof line, f) != NULL) {
+                    newProcess = malloc(sizeof(process));
                     initializeProcess(line, newProcess);
                     if (newProcess->timeArrived == readAhead->timeArrived) {
                         llist_add_inorder(newProcess, arrivals, (int (*)(void *, void *)) &leastExecutionTime);