Commit ee26d83e authored by Yousong Zhou's avatar Yousong Zhou Committed by Jo-Philipp Wich

main: exec_self: make clang analyzer happy

Prevent a theoretical leak of the args memory when the executable path
cannot be found.
Signed-off-by: default avatarYousong Zhou <>
[fix whitespace, commit description]
Signed-off-by: default avatarJo-Philipp Wich <>
parent 90e40bd3
......@@ -47,10 +47,15 @@ static void
exec_self(int argc, char **argv)
int i;
const char *cmd = rpc_exec_lookup(argv[0]);
char **args = calloc(argc + 1, sizeof(char *));
const char *cmd;
char **args;
if (!cmd || !args)
cmd = rpc_exec_lookup(argv[0]);
if (!cmd)
args = calloc(argc + 1, sizeof(char *));
if (!args)
for (i = 0; i < argc; i++)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment