aboutsummaryrefslogtreecommitdiff
path: root/libssh/sftp.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-04-28 18:43:41 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-04-28 18:43:41 +0200
commit20e7ec96ae01d4367a7fbcd87bdbf0fa6496492b (patch)
treee2c7e9e7bda246d0b376ffeb3d19252b6f3f1c5e /libssh/sftp.c
parent2e563e0fa88aa174d3b945202fbe8f81a81bd4c3 (diff)
downloadlibssh-20e7ec96ae01d4367a7fbcd87bdbf0fa6496492b.tar.gz
libssh-20e7ec96ae01d4367a7fbcd87bdbf0fa6496492b.tar.xz
libssh-20e7ec96ae01d4367a7fbcd87bdbf0fa6496492b.zip
Fix bugs found by clang analyzer
Diffstat (limited to 'libssh/sftp.c')
-rw-r--r--libssh/sftp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c
index 51411427..82c00341 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -104,12 +104,10 @@ static void sftp_ext_free(sftp_ext ext) {
sftp_session sftp_new(ssh_session session){
sftp_session sftp;
- enter_function();
-
if (session == NULL) {
- leave_function();
return NULL;
}
+ enter_function();
sftp = malloc(sizeof(struct sftp_session_struct));
if (sftp == NULL) {
@@ -123,7 +121,7 @@ sftp_session sftp_new(ssh_session session){
if (sftp->ext == NULL) {
ssh_set_error_oom(session);
SAFE_FREE(sftp);
- sftp_leave_function();
+ leave_function();
return NULL;
}