summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Long <ryan.long@oarcorp.com>2021-03-10 13:51:20 -0500
committerJoel Sherrill <joel@rtems.org>2021-04-29 09:48:00 -0500
commit8cf30c41d9336f61e37eeb29617e5a13532c7c3d (patch)
tree60d0456eab8abfc2f946a20534deb7a44ab1f6cc
parentcdf66529fd2dcbedc27f0ac9ac2f3e4737ea4d0b (diff)
downloadrtems-8cf30c41d9336f61e37eeb29617e5a13532c7c3d.tar.bz2
main_rtrace.c: Add error return when malloc fails
CID 1399709: Dereference after null check in rtems_trace_buffering_shell_save(). Closes #4329
-rw-r--r--cpukit/libmisc/shell/main_rtrace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cpukit/libmisc/shell/main_rtrace.c b/cpukit/libmisc/shell/main_rtrace.c
index 753ab9dd34..e4f59c4d79 100644
--- a/cpukit/libmisc/shell/main_rtrace.c
+++ b/cpukit/libmisc/shell/main_rtrace.c
@@ -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);