* ensure there is enough room for the answer and truncate the question
* to fit.
*/
- answer_string = malloc (COLS + 1);
+ answer_string = safe_malloc (COLS + 1);
snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def ? yes : no, def ? no : yes);
answer_string_len = strlen (answer_string);
printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
size_t error_buf_len;
error_buf_len = sizeof ("fopen: ") - 1 + strlen (ringfile) + 1;
- error_buf = malloc (error_buf_len);
+ error_buf = safe_malloc (error_buf_len);
snprintf (error_buf, error_buf_len, "fopen: %s", ringfile);
perror (error_buf);
- free (error_buf);
+ safe_free (&error_buf);
return;
}