Skip to content
Snippets Groups Projects
Commit 12ca181e authored by Aomx's avatar Aomx
Browse files

added state_free at error conditions, which were not handled before..

parent 6725d58d
No related branches found
No related tags found
No related merge requests found
......@@ -618,6 +618,7 @@ void run_code_event(struct state *state, struct event *event,
return;
error_out:
state_free(state);
die("%s:%d: runtime error in code: %s\n",
state->config->script_path, event->line_number, error);
free(error);
......
......@@ -401,6 +401,7 @@ static void run_local_packet_event(struct state *state, struct event *event,
fprintf(stderr, "%s", error);
free(error);
} else if (result == STATUS_ERR) {
state_free(state);
die("%s", error);
}
}
......@@ -588,6 +589,7 @@ void run_script(struct config *config, struct script *script)
wire_client_next_event(state->wire_client, NULL);
if (code_execute(state->code, &error)) {
state_free(state);
die("%s: error executing code: %s\n",
state->config->script_path, error);
free(error);
......
......@@ -48,6 +48,7 @@ void run_command_event(
return;
error_out:
state_free(state);
die("%s:%d: error executing `%s` command: %s\n",
state->config->script_path, event->line_number,
command->command_line, error);
......
......@@ -1958,6 +1958,7 @@ static void invoke_system_call(
return;
error_out:
state_free(state);
die("%s:%d: runtime error in %s call: %s\n",
state->config->script_path, event->line_number,
syscall->name, error);
......@@ -2058,6 +2059,7 @@ static void enqueue_system_call(
return;
error_out:
state_free(state);
die("%s:%d: runtime error in %s call: %s\n",
state->config->script_path, event->line_number,
syscall->name, error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment