main_rtrace.c: Add error return when malloc fails

CID 1399709: Dereference after null check in
rtems_trace_buffering_shell_save().

Closes #4329
This commit is contained in:
Ryan Long
2021-03-10 13:51:20 -05:00
committed by Joel Sherrill
parent cdf66529fd
commit 8cf30c41d9

View File

@@ -473,6 +473,7 @@ rtems_trace_buffering_shell_save (int argc, char *argv[])
{
close (out);
printf ("error: no memory\n");
return 1;
}
memset (buf, 0, SAVE_BUF_SIZE);