*/
authlist = libssh2_userauth_list(ssh->ssh_session, ssh->user,
strlen(ssh->user));
+ if (!authlist) {
+ libssh2_session_free(ssh->ssh_session);
+ ssh->ssh_session = NULL;
+ Curl_safefree(ssh->path);
+ return CURLE_OUT_OF_MEMORY;
+ }
infof(data, "SSH authentication methods available: %s\n", authlist);
/*
infof(conn->data, "Initialized keyboard interactive authentication\n");
}
}
+ Curl_safefree((void *)authlist);
+ authlist = NULL;
if (!authed) {
failf(data, "Authentication failure\n");
}
}
- /* Check for /~/ , indicating realative to the users home directory */
+ /* Check for /~/ , indicating relative to the user's home directory */
if (conn->protocol == PROT_SCP) {
real_path = (char *)malloc(working_path_len+1);
if (real_path == NULL) {
}
else {
/*
- * We must check the remote file, if it is a directory no vaules will
+ * We must check the remote file; if it is a directory no values will
* be set in sb
*/
curl_off_t bytecount;
attrs.filesize);
}
if (attrs.flags & LIBSSH2_SFTP_ATTR_ACMODTIME) {
- const char *months[12] = {
+ static const char * const months[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
struct tm *nowParts;