|
|
|
@ -179,6 +179,10 @@ pre_functions_output_request_add(struct sandbox_request *request, char *output,
|
|
|
|
|
**/
|
|
|
|
|
static inline void
|
|
|
|
|
concatenate_outputs(struct sandbox_request *request) {
|
|
|
|
|
if(request->pre_functions_output == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size_t total_length = 0; // Calculate total length without extra for null character
|
|
|
|
|
struct sandbox_pre_functions_output *current = request->pre_functions_output;
|
|
|
|
|
|
|
|
|
@ -229,5 +233,19 @@ concatenate_outputs(struct sandbox_request *request) {
|
|
|
|
|
request->previous_function_output = NULL;
|
|
|
|
|
}
|
|
|
|
|
request->output_length = total_length;
|
|
|
|
|
request->previous_function_output = concatenated_output;
|
|
|
|
|
request->previous_function_output = concatenated_output;
|
|
|
|
|
|
|
|
|
|
/**/
|
|
|
|
|
if (request->pre_functions_output != NULL)
|
|
|
|
|
{
|
|
|
|
|
struct sandbox_pre_functions_output *current = request->pre_functions_output;
|
|
|
|
|
struct sandbox_pre_functions_output *next = NULL;
|
|
|
|
|
while (current) {
|
|
|
|
|
next = current->next;
|
|
|
|
|
free(current->previous_function_output);
|
|
|
|
|
free(current);
|
|
|
|
|
current = next; }
|
|
|
|
|
request->pre_functions_output = NULL;
|
|
|
|
|
}
|
|
|
|
|
pthread_spin_destroy(&request->lock);
|
|
|
|
|
}
|
|
|
|
|