1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

tests: Cleanup OpenSSL in the forked server processes

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 7eefbbd478)
This commit is contained in:
Jakub Jelen
2025-07-24 18:57:31 +02:00
parent b298a04f96
commit d64f06f98a
5 changed files with 74 additions and 7 deletions

View File

@@ -22,6 +22,7 @@
*/
#include "test_server.h"
#include "testserver_common.h"
#include <libssh/priv.h>
#include <libssh/libssh.h>
@@ -288,6 +289,7 @@ int run_server(struct server_state_st *state)
free_server_state(state);
SAFE_FREE(state);
finalize_openssl();
exit(0);
case -1:
fprintf(stderr, "Failed to fork\n");
@@ -355,11 +357,8 @@ fork_run_server(struct server_state_st *state,
/* The child process starts a server which will listen for connections */
rc = run_server(state);
if (rc != 0) {
exit(rc);
}
exit(0);
finalize_openssl();
exit(rc);
case -1:
strerror_r(errno, err_str, 1024);
fprintf(stderr, "Failed to fork: %s\n",