diff options
author | Luo Yifan <luoyifan@cmss.chinamobile.com> | 2024-11-11 10:17:01 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-11-13 20:27:35 +0100 |
commit | 31bedc1fb1d93250ae1900ee92ccd56689956d22 (patch) | |
tree | d30055058b2643c3bc209ce2b844c845059a907b /tools/lib | |
parent | perf timechart: Remove redundant variable assignment (diff) | |
download | linux-31bedc1fb1d93250ae1900ee92ccd56689956d22.tar.xz linux-31bedc1fb1d93250ae1900ee92ccd56689956d22.zip |
libsubcmd: Move va_end() before exit
This patch makes a minor adjustment by moving the va_end call before
exit. Since the exit() function terminates the program, any code
after exit(128) (i.e., va_end(params)) is unreachable and thus not
executed. Placing va_end before exit ensures that the va_list is
properly cleaned up.
Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20241111091701.275496-1-luoyifan@cmss.chinamobile.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/subcmd/subcmd-util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h index dfac76e35ac7..c742b08815dc 100644 --- a/tools/lib/subcmd/subcmd-util.h +++ b/tools/lib/subcmd/subcmd-util.h @@ -20,8 +20,8 @@ static __noreturn inline void die(const char *err, ...) va_start(params, err); report(" Fatal: ", err, params); - exit(128); va_end(params); + exit(128); } #define zfree(ptr) ({ free(*ptr); *ptr = NULL; }) |