if (!cinfo->cmd_line)
return false;
+ if (!read_proc_file(cinfo->tid_info, "comm", buf, sizeof(buf), filter_drop_trailing_whitespace))
+ goto err;
+
+ cinfo->comm = strdup(buf);
+ if (!cinfo->comm)
+ goto err;
+
if (!get_exe_path(cinfo->pid_info, buf, sizeof(buf)))
goto err;
err:
free(cinfo->cmd_line);
cinfo->cmd_line = NULL;
+ free(cinfo->comm);
+ cinfo->comm = NULL;
return false;
}
char pid_str[11], tid_str[11], sig_str[11];
char *prstatus_fd_str = NULL;
- char tid_comm_str[KERNEL_DEFINED_TASK_COMM_LEN + 1] = { 0, };
-
- (void)read_proc_file(cinfo->tid_info, "comm", tid_comm_str, sizeof(tid_comm_str), filter_drop_trailing_whitespace);
if (asprintf(&prstatus_fd_str, "%d", cinfo->prstatus_fd) == -1) {
_E("Unable to allocate memory: %m");
"--reportpath", cinfo->result_path,
"--prstatus_fd", prstatus_fd_str,
"--signal", sig_str,
- "--tid-comm", tid_comm_str,
+ "--tid-comm", cinfo->comm,
legacy_notification_str,
NULL };
{
free(cinfo->cmd_line);
free(cinfo->cmd_path);
+ free(cinfo->comm);
free(cinfo->temp_dir);
free(cinfo->result_path);
free(cinfo->app_root_path);
cinfo->executable_path = NULL;
cinfo->cmd_line = NULL;
cinfo->cmd_path = NULL;
+ cinfo->comm = NULL;
cinfo->temp_dir = NULL;
cinfo->app_root_path = NULL;
cinfo->pfx = NULL;