mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-22 05:21:51 +03:00
example: Add missing error checks in ssh_server_fork
CID 1393676 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -621,6 +621,7 @@ int main(int argc, char **argv) {
|
|||||||
ssh_session session;
|
ssh_session session;
|
||||||
ssh_event event;
|
ssh_event event;
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* Set up SIGCHLD handler. */
|
/* Set up SIGCHLD handler. */
|
||||||
sa.sa_handler = sigchld_handler;
|
sa.sa_handler = sigchld_handler;
|
||||||
@ -631,8 +632,17 @@ int main(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_init();
|
rc = ssh_init();
|
||||||
|
if (rc < 0) {
|
||||||
|
fprintf(stderr, "ssh_init failed\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
sshbind = ssh_bind_new();
|
sshbind = ssh_bind_new();
|
||||||
|
if (sshbind == NULL) {
|
||||||
|
fprintf(stderr, "ssh_bind_new failed\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_ARGP_H
|
#ifdef HAVE_ARGP_H
|
||||||
argp_parse(&argp, argc, argv, 0, 0, sshbind);
|
argp_parse(&argp, argc, argv, 0, 0, sshbind);
|
||||||
|
Reference in New Issue
Block a user