From d63dcce9ef44db9e7bcf02e1d904c7f8c433aab8 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Fri, 30 Sep 2022 08:36:59 -0600 Subject: [PATCH] tools/cgdelete: add check for the cmdline arguments Like other tools, throw an error and exit if the minimum required arguments are not passed. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka (cherry picked from commit de86f6862d439f4c680f07f02a1496661bb1f7a7) --- src/tools/cgdelete.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tools/cgdelete.c b/src/tools/cgdelete.c index 7eaab2cb..28ddca35 100644 --- a/src/tools/cgdelete.c +++ b/src/tools/cgdelete.c @@ -123,6 +123,11 @@ int main(int argc, char *argv[]) int i, j, c; int skip; + if (argc < 2) { + usage(1, argv[0]); + exit (1); + } + /* initialize libcg */ ret = cgroup_init(); if (ret) { -- 2.47.2