diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index e4d35bbdcf..4e2a72269f 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -148,7 +148,9 @@ static void kbd_callback(const char *name, int name_len, #endif /* CURL_LIBSSH2_DEBUG */ if(num_prompts == 1) { struct connectdata *conn = data->conn; - responses[0].text = curlx_strdup(conn->passwd); + /* this function must allocate memory that can be freed by libssh2, which + uses the LIBSSH2_FREE_FUNC callback */ + responses[0].text = Curl_cstrdup(conn->passwd); responses[0].length = responses[0].text == NULL ? 0 : curlx_uztoui(strlen(conn->passwd)); }