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

src: Remove enter_function() and leave_function().

This commit is contained in:
Andreas Schneider
2013-07-14 13:31:24 +02:00
parent 0d3deeec10
commit c64ec43eef
22 changed files with 267 additions and 494 deletions

View File

@@ -106,12 +106,11 @@ sftp_session sftp_new(ssh_session session){
if (session == NULL) {
return NULL;
}
enter_function();
sftp = malloc(sizeof(struct sftp_session_struct));
if (sftp == NULL) {
ssh_set_error_oom(session);
leave_function();
return NULL;
}
ZERO_STRUCTP(sftp);
@@ -120,7 +119,7 @@ sftp_session sftp_new(ssh_session session){
if (sftp->ext == NULL) {
ssh_set_error_oom(session);
SAFE_FREE(sftp);
leave_function();
return NULL;
}
@@ -128,24 +127,23 @@ sftp_session sftp_new(ssh_session session){
sftp->channel = ssh_channel_new(session);
if (sftp->channel == NULL) {
SAFE_FREE(sftp);
leave_function();
return NULL;
}
if (ssh_channel_open_session(sftp->channel)) {
ssh_channel_free(sftp->channel);
SAFE_FREE(sftp);
leave_function();
return NULL;
}
if (ssh_channel_request_sftp(sftp->channel)) {
sftp_free(sftp);
leave_function();
return NULL;
}
leave_function();
return sftp;
}
@@ -155,12 +153,11 @@ sftp_session sftp_new_channel(ssh_session session, ssh_channel channel){
if (session == NULL) {
return NULL;
}
enter_function();
sftp = malloc(sizeof(struct sftp_session_struct));
if (sftp == NULL) {
ssh_set_error_oom(session);
leave_function();
return NULL;
}
ZERO_STRUCTP(sftp);
@@ -169,14 +166,13 @@ sftp_session sftp_new_channel(ssh_session session, ssh_channel channel){
if (sftp->ext == NULL) {
ssh_set_error_oom(session);
SAFE_FREE(sftp);
leave_function();
return NULL;
}
sftp->session = session;
sftp->channel = channel;
leave_function();
return sftp;
}