Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
trace fixes
Browse files Browse the repository at this point in the history
- 'command_name' is not required
- fix double free of task context
  • Loading branch information
waynz0r committed Apr 30, 2024
1 parent 943f928 commit 1e7c7d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/device_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,7 @@ static int parse_command(const char *data)
const char *command_name = json_object_get_string(data_root, "command_name");
if (!command_name)
{
pr_err("missing 'command_name' property # command[%s]", command);
status = -EINVAL;
goto request_trace_out;
command_name = "";
}

pr_debug("manage trace # command[%s] action[%s] pid[%d] uid[%d] command_name[%s]", command, action, pid, uid, command_name);
Expand Down
3 changes: 3 additions & 0 deletions src/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ int trace_log(const tcp_connection_context *conn_ctx, const char *message, int l
va_end(args);

send_message("log", json_serialize_to_string(root_value), task_ctx);
json_value_free(root_value);

return ret;

out:
json_value_free(root_value);
Expand Down

0 comments on commit 1e7c7d1

Please sign in to comment.