libsubcmd: Move va_end() before exit
authorLuo Yifan <luoyifan@cmss.chinamobile.com>
Mon, 11 Nov 2024 09:17:01 +0000 (17:17 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Nov 2024 19:27:35 +0000 (16:27 -0300)
commit31bedc1fb1d93250ae1900ee92ccd56689956d22
treed30055058b2643c3bc209ce2b844c845059a907b
parentb81bb703372837a6d6b4cc964b6db58d1dfdba8b
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>
tools/lib/subcmd/subcmd-util.h