diff mbox series

Fix coverity #332450

Message ID 20210625134235.1118406-1-stefano.babic@babic.homelinux.org
State Accepted
Headers show
Series Fix coverity #332450 | expand

Commit Message

Stefano Babic June 25, 2021, 1:42 p.m. UTC
From: Stefano Babic <sbabic@denx.de>

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/swupdate.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index b39cff9..949a647 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -425,6 +425,10 @@  static int read_processes_settings(void *settings, void *data)
 			continue;
 
 		proc = (struct extproc *)calloc(1, sizeof(struct extproc));
+		if (!proc) {
+			ERROR("OOM reading process settings, exiting...");
+			exit(EXIT_FAILURE);
+		}
 
 		GET_FIELD_STRING(LIBCFG_PARSER, elem, "name", proc->name);
 		GET_FIELD_STRING(LIBCFG_PARSER, elem, "exec", proc->exec);