- char *specific_problem_str = malloc(specific_problem_len);
- memset(specific_problem_str, '\0', specific_problem_len);
- snprintf(specific_problem_str, specific_problem_len, "process %s (%d) %s",
- process, pid, (state == 0 ? PROCEVENT_SPECIFIC_PROBLEM_DOWN_VALUE
- : PROCEVENT_SPECIFIC_PROBLEM_UP_VALUE));
-
- if (yajl_gen_string(g, (u_char *)specific_problem_str,
- strlen(specific_problem_str)) != yajl_gen_status_ok) {
- sfree(specific_problem_str);
+ memset(json_str, '\0', DATA_MAX_NAME_LEN);
+ snprintf(json_str, specific_problem_len, "process %s (%d) %s", process, pid,
+ (state == 0 ? PROCEVENT_SPECIFIC_PROBLEM_DOWN_VALUE
+ : PROCEVENT_SPECIFIC_PROBLEM_UP_VALUE));
+
+ if (yajl_gen_string(g, (u_char *)json_str, strlen(json_str)) !=
+ yajl_gen_status_ok) {