mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
libssh: fix minor static code analyzer nits
- remove superfluous NULL check which otherwise tricks the static code analyzers to assume NULL pointer dereferences. - fix fallthrough in switch() - indent mistake
This commit is contained in:
parent
10bb0b4719
commit
3cef6f22ea
@ -342,11 +342,15 @@ static int myssh_is_known(struct connectdata *conn)
|
|||||||
switch(vstate) {
|
switch(vstate) {
|
||||||
case SSH_SERVER_KNOWN_OK:
|
case SSH_SERVER_KNOWN_OK:
|
||||||
keymatch = CURLKHMATCH_OK;
|
keymatch = CURLKHMATCH_OK;
|
||||||
|
break;
|
||||||
case SSH_SERVER_FILE_NOT_FOUND:
|
case SSH_SERVER_FILE_NOT_FOUND:
|
||||||
|
/* fallthrough */
|
||||||
case SSH_SERVER_NOT_KNOWN:
|
case SSH_SERVER_NOT_KNOWN:
|
||||||
keymatch = CURLKHMATCH_MISSING;
|
keymatch = CURLKHMATCH_MISSING;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
keymatch = CURLKHMATCH_MISMATCH;
|
keymatch = CURLKHMATCH_MISMATCH;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(func) { /* use callback to determine action */
|
if(func) { /* use callback to determine action */
|
||||||
@ -994,8 +998,8 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
if(statvfs != 0 && !sshc->acceptfail) {
|
if(statvfs != 0 && !sshc->acceptfail) {
|
||||||
Curl_safefree(sshc->quote_path1);
|
Curl_safefree(sshc->quote_path1);
|
||||||
err = sftp_get_error(sshc->sftp_session);
|
err = sftp_get_error(sshc->sftp_session);
|
||||||
failf(data, "statvfs command failed: %s",
|
failf(data, "statvfs command failed: %s (%d)",
|
||||||
ssh_get_error(sshc->ssh_session));
|
ssh_get_error(sshc->ssh_session), err);
|
||||||
state(conn, SSH_SFTP_CLOSE);
|
state(conn, SSH_SFTP_CLOSE);
|
||||||
sshc->nextstate = SSH_NO_STATE;
|
sshc->nextstate = SSH_NO_STATE;
|
||||||
sshc->actualcode = CURLE_QUOTE_ERROR;
|
sshc->actualcode = CURLE_QUOTE_ERROR;
|
||||||
@ -1620,7 +1624,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
|
|||||||
sftp_close(sshc->sftp_file);
|
sftp_close(sshc->sftp_file);
|
||||||
sshc->sftp_file = NULL;
|
sshc->sftp_file = NULL;
|
||||||
}
|
}
|
||||||
if(protop)
|
|
||||||
Curl_safefree(protop->path);
|
Curl_safefree(protop->path);
|
||||||
|
|
||||||
DEBUGF(infof(data, "SFTP DONE done\n"));
|
DEBUGF(infof(data, "SFTP DONE done\n"));
|
||||||
|
Loading…
Reference in New Issue
Block a user