From 018a7b7927b76044b28eece39039cb2f5ea9c192 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 20 Oct 2021 21:13:58 +0200 Subject: [PATCH] server: Early vss shutdown for command handlers. Command must communicate with the vss through the shared memory area (mmd). Deallocating all resources early in the command handler makes the code more robust and saves some memory. --- server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.c b/server.c index 1020e4fe..e0df714b 100644 --- a/server.c +++ b/server.c @@ -679,12 +679,13 @@ int main(int argc, char *argv[]) deplete_close_on_fork_list(); if (ret < 0) PARA_EMERG_LOG("%s\n", para_strerror(-ret)); + vss_shutdown(); } else { + vss_shutdown(); alarm(ALARM_TIMEOUT); close_listed_fds(); ret = handle_connect(sct->child_fd); } - vss_shutdown(); shm_detach(mmd); user_list_deplete(); free_lpr(); -- 2.39.5