diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-11-30 18:52:18 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-11-30 18:52:40 +0100 |
commit | 3784226fd85bc1256ef927640f4d400348da038f (patch) | |
tree | bd20fa5bca70c6b6fb57f4267707c72732b5833d /src/sftp.c | |
parent | cf24048f0251f823625ddde892c3b8de93cefd25 (diff) | |
download | libssh-3784226fd85bc1256ef927640f4d400348da038f.tar.gz libssh-3784226fd85bc1256ef927640f4d400348da038f.tar.xz libssh-3784226fd85bc1256ef927640f4d400348da038f.zip |
sftp: Do not overwrite errors set by channel functions
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/sftp.c')
-rw-r--r-- | src/sftp.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -115,22 +115,26 @@ sftp_session sftp_new(ssh_session session) sftp->ext = sftp_ext_new(); if (sftp->ext == NULL) { + ssh_set_error_oom(session); goto error; } sftp->read_packet = calloc(1, sizeof(struct sftp_packet_struct)); if (sftp->read_packet == NULL) { + ssh_set_error_oom(session); goto error; } sftp->read_packet->payload = ssh_buffer_new(); if (sftp->read_packet->payload == NULL) { + ssh_set_error_oom(session); goto error; } sftp->session = session; sftp->channel = ssh_channel_new(session); if (sftp->channel == NULL) { + ssh_set_error_oom(session); goto error; } @@ -144,7 +148,6 @@ sftp_session sftp_new(ssh_session session) return sftp; error: - ssh_set_error_oom(session); if (sftp->ext != NULL) { sftp_ext_free(sftp->ext); } |