aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ssh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 23ba5f4e0..e92916e9d 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1885,9 +1885,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
Curl_safefree(sshc->readdir_linkPath);
sshc->readdir_linkPath = NULL;
- new_readdir_line = realloc(sshc->readdir_line,
- sshc->readdir_totalLen + 4 +
- sshc->readdir_len);
+ /* get room for the filename and extra output */
+ sshc->readdir_totalLen += 4 + sshc->readdir_len:
+ new_readdir_line = realloc(sshc->readdir_line, sshc->readdir_totalLen);
if(!new_readdir_line) {
Curl_safefree(sshc->readdir_line);
sshc->readdir_line = NULL;