From 35ca3404b62a86b5e1e42e1108c3ffa139540319 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Fri, 11 Aug 2023 12:25:04 +0530 Subject: [PATCH] src/daemon/cgrulesengd.c: fix coding style complaint Fix the checkpatch.pl warnings, making it coding style complaint. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- src/daemon/cgrulesengd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c index 51988de5..dc396900 100644 --- a/src/daemon/cgrulesengd.c +++ b/src/daemon/cgrulesengd.c @@ -223,6 +223,7 @@ static int cgre_store_parent_info(pid_t pid) if (array_pi.index >= array_pi.num_allocation) { int alloc = array_pi.num_allocation + NUM_PER_REALLOCATIOM; void *new_array = realloc(array_pi.parent_info, sizeof(info) * alloc); + if (!new_array) { flog(LOG_WARNING, "Failed to allocate memory\n"); return 1; @@ -314,6 +315,7 @@ static int cgre_store_unchanged_process(pid_t pid, int flags) if (array_unch.index >= array_unch.num_allocation) { int alloc = array_unch.num_allocation + NUM_PER_REALLOCATIOM; void *new_array = realloc(array_unch.proc, sizeof(unchanged_pid_t) * alloc); + if (!new_array) { flog(LOG_WARNING, "Failed to allocate memory\n"); return 1; -- 2.47.2