summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-11-25 00:33:59 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-11-25 00:33:59 +0100
commit42df4f10f81cf23b3740ffda608be8c1b518e182 (patch)
tree7fdfab99cf2f455172c5067e27140ce2d915811c
parent3da4ebad30c049b5d58df1f8bccf6686554a300f (diff)
downloadcurl-bagder/ssh-remove-NULL-check.tar.gz
ssh: remove check for a NULL pointer (!)bagder/ssh-remove-NULL-check
With this check present, scan-build warns that we might dereference this point in other places where it isn't first checked for NULL. Thus, if it *can* be NULL we have a problem on a few places. However, this pointer should not be possible to be NULL here so I remove the check and thus also three different scan-build warnings.
-rw-r--r--lib/ssh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index c4a369997..2496e7cff 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -2347,8 +2347,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
}
sshc->sftp_handle = NULL;
}
- if(sftp_scp)
- Curl_safefree(sftp_scp->path);
+
+ Curl_safefree(sftp_scp->path);
DEBUGF(infof(data, "SFTP DONE done\n"));