From: Daniel Stenberg Date: Fri, 24 Nov 2017 23:33:59 +0000 (+0100) Subject: ssh: remove check for a NULL pointer (!) X-Git-Tag: curl-7_57_0~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c79b2ca03d94d996c23cee13859735cc278838c1;p=thirdparty%2Fcurl.git ssh: remove check for a NULL pointer (!) 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. Closes #2111 --- diff --git a/lib/ssh.c b/lib/ssh.c index c4a3699973..2496e7cff3 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"));