* checks will fail if template pointer is reused.
*/
mem_d(*template);
- task_template_nullify(*template);
- *template = NULL;
+ //task_template_nullify(*template);
+ //*template = NULL;
}
/*
*/
success = !!!(strcmp(data, template->comparematch[compare++]));
}
+ mem_d(data);
+ data = NULL;
}
pclose(execute);
return success;
*/
void task_schedualize(const char *curdir) {
bool execute = false;
- char *back = NULL;
char *data = NULL;
size_t size = 0;
size_t i;
* then we do the same for stderr.
*/
while (util_getline(&data, &size, task_tasks[i].runhandles[1]) != EOF) {
- back = data;
fputs(data, task_tasks[i].stdoutlog);
fflush(task_tasks[i].stdoutlog);
}
while (util_getline(&data, &size, task_tasks[i].runhandles[2]) != EOF) {
- back = data;
/*
* If a string contains an error we just dissalow execution
* of it in the vm.
fputs(data, task_tasks[i].stderrlog);
fflush(task_tasks[i].stdoutlog);
}
+ //mem_d(data);
- if (back)
- mem_d(back);
/*
* If we can execute we do so after all data has been read and
task_tasks[i].template->successmessage : "unknown"
);
}
- if (back)
- mem_d(back);
+ mem_d(data);
}
/*
int c = getc(stream);
if (chr < 2) {
- char *tmp = (char*)mem_a((*n+=(*n>16)?*n:64));
- if (!tmp)
- return -1;
-
- memcpy(tmp, *lineptr, pos - *lineptr);
chr = *n + *lineptr - pos;
- if (!(*lineptr = tmp)) {
- mem_d (tmp);
+ if (!(*lineptr = (char*)mem_r(*lineptr,(*n+=(*n>16)?*n:64))))
return -1;
- }
pos = *n - chr + *lineptr;
}