projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the calculation of the exchange hash to above the various
[u/mdw/putty]
/
psftp.c
diff --git
a/psftp.c
b/psftp.c
index
65d0dc5
..
322b9c6
100644
(file)
--- a/
psftp.c
+++ b/
psftp.c
@@
-291,6
+291,11
@@
int sftp_get_file(char *fname, char *outfname, int recurse, int restart)
if (fxp_error_type() == SSH_FX_EOF)
break;
printf("%s: reading directory: %s\n", fname, fxp_error());
if (fxp_error_type() == SSH_FX_EOF)
break;
printf("%s: reading directory: %s\n", fname, fxp_error());
+
+ req = fxp_close_send(dirhandle);
+ pktin = sftp_wait_for_reply(req);
+ fxp_close_recv(pktin, req);
+
sfree(ournames);
return 0;
}
sfree(ournames);
return 0;
}
@@
-463,6
+468,8
@@
int sftp_get_file(char *fname, char *outfname, int recurse, int restart)
printf("error while reading: %s\n", fxp_error());
shown_err = TRUE;
}
printf("error while reading: %s\n", fxp_error());
shown_err = TRUE;
}
+ if (ret == INT_MIN) /* pktin not even freed */
+ sfree(pktin);
ret = 0;
}
ret = 0;
}
@@
-715,9
+722,13
@@
int sftp_put_file(char *fname, char *outfname, int recurse, int restart)
if (!xfer_done(xfer)) {
pktin = sftp_recv();
ret = xfer_upload_gotpkt(xfer, pktin);
if (!xfer_done(xfer)) {
pktin = sftp_recv();
ret = xfer_upload_gotpkt(xfer, pktin);
- if (ret <= 0 && !err) {
- printf("error while writing: %s\n", fxp_error());
- err = 1;
+ if (ret <= 0) {
+ if (ret == INT_MIN) /* pktin not even freed */
+ sfree(pktin);
+ if (!err) {
+ printf("error while writing: %s\n", fxp_error());
+ err = 1;
+ }
}
}
}
}
}
}
@@
-911,6
+922,7
@@
int wildcard_iterate(char *filename, int (*func)(void *, char *), void *ctx)
printf("%s: canonify: %s\n", newname, fxp_error());
ret = 0;
}
printf("%s: canonify: %s\n", newname, fxp_error());
ret = 0;
}
+ sfree(newname);
matched = TRUE;
ret &= func(ctx, cname);
sfree(cname);
matched = TRUE;
ret &= func(ctx, cname);
sfree(cname);
@@
-1023,6
+1035,7
@@
int sftp_cmd_ls(struct sftp_command *cmd)
char *tmpdir;
int len, check;
char *tmpdir;
int len, check;
+ sfree(unwcdir);
wildcard = stripslashes(dir, 0);
unwcdir = dupstr(dir);
len = wildcard - dir;
wildcard = stripslashes(dir, 0);
unwcdir = dupstr(dir);
len = wildcard - dir;
@@
-2221,6
+2234,7
@@
struct sftp_command *sftp_getcmd(FILE *fp, int mode, int modeflags)
cmd->obey = sftp_cmd_quit;
if ((mode == 0) || (modeflags & 1))
printf("quit\n");
cmd->obey = sftp_cmd_quit;
if ((mode == 0) || (modeflags & 1))
printf("quit\n");
+ sfree(line);
return cmd; /* eof */
}
return cmd; /* eof */
}