1
0
mirror of https://github.com/torvalds/linux.git synced 2025-04-12 16:47:42 +00:00

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>
This commit is contained in:
Luo Yifan 2024-11-11 17:17:01 +08:00 committed by Arnaldo Carvalho de Melo
parent b81bb70337
commit 31bedc1fb1

@ -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; })