]> granicus.if.org Git - curl/commitdiff
ssh: remove check for a NULL pointer (!)
authorDaniel Stenberg <daniel@haxx.se>
Fri, 24 Nov 2017 23:33:59 +0000 (00:33 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 25 Nov 2017 21:52:36 +0000 (22:52 +0100)
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

lib/ssh.c

index c4a369997318cd6c9fa9f1d3eac85c5373582cc0..2496e7cff3d1ec4529a9b6d452c4cea7bc989779 100644 (file)
--- 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"));