summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-06-02 07:31:17 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-06-02 07:31:17 +1000
commita627d42e51ffa71e014d7b2d2c07118122fd3ec3 (patch)
tree7bda769de81f509e28d800916fa20abd37906d79 /sftp-client.c
parentc7aad0058c957afeb26a3f703e8cb0eddeb62365 (diff)
- djm@cvs.openbsd.org 2013/05/17 00:13:13
[xmalloc.h cipher.c sftp-glob.c ssh-keyscan.c ssh.c sftp-common.c ssh-ecdsa.c auth2-chall.c compat.c readconf.c kexgexs.c monitor.c gss-genr.c cipher-3des1.c kex.c monitor_wrap.c ssh-pkcs11-client.c auth-options.c rsa.c auth2-pubkey.c sftp.c hostfile.c auth2.c servconf.c auth.c authfile.c xmalloc.c uuencode.c sftp-client.c auth2-gss.c sftp-server.c bufaux.c mac.c session.c jpake.c kexgexc.c sshconnect.c auth-chall.c auth2-passwd.c sshconnect1.c buffer.c kexecdhs.c kexdhs.c ssh-rsa.c auth1.c ssh-pkcs11.c auth2-kbdint.c kexdhc.c sshd.c umac.c ssh-dss.c auth2-jpake.c bufbn.c clientloop.c monitor_mm.c scp.c roaming_client.c serverloop.c key.c auth-rsa.c ssh-pkcs11-helper.c ssh-keysign.c ssh-keygen.c match.c channels.c sshconnect2.c addrmatch.c mux.c canohost.c kexecdhc.c schnorr.c ssh-add.c misc.c auth2-hostbased.c ssh-agent.c bufec.c groupaccess.c dns.c packet.c readpass.c authfd.c moduli.c] bye, bye xfree(); ok markus@
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 85f2bd444..038e1c347 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-client.c,v 1.97 2012/07/02 12:13:26 dtucker Exp $ */ 1/* $OpenBSD: sftp-client.c,v 1.98 2013/05/17 00:13:14 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -394,8 +394,8 @@ do_init(int fd_in, int fd_out, u_int transfer_buflen, u_int num_requests,
394 } else { 394 } else {
395 debug2("Unrecognised server extension \"%s\"", name); 395 debug2("Unrecognised server extension \"%s\"", name);
396 } 396 }
397 xfree(name); 397 free(name);
398 xfree(value); 398 free(value);
399 } 399 }
400 400
401 buffer_free(&msg); 401 buffer_free(&msg);
@@ -509,7 +509,7 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
509 error("Couldn't read directory: %s", 509 error("Couldn't read directory: %s",
510 fx2txt(status)); 510 fx2txt(status));
511 do_close(conn, handle, handle_len); 511 do_close(conn, handle, handle_len);
512 xfree(handle); 512 free(handle);
513 buffer_free(&msg); 513 buffer_free(&msg);
514 return(status); 514 return(status);
515 } 515 }
@@ -552,14 +552,14 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
552 (*dir)[++ents] = NULL; 552 (*dir)[++ents] = NULL;
553 } 553 }
554 next: 554 next:
555 xfree(filename); 555 free(filename);
556 xfree(longname); 556 free(longname);
557 } 557 }
558 } 558 }
559 559
560 buffer_free(&msg); 560 buffer_free(&msg);
561 do_close(conn, handle, handle_len); 561 do_close(conn, handle, handle_len);
562 xfree(handle); 562 free(handle);
563 563
564 /* Don't return partial matches on interrupt */ 564 /* Don't return partial matches on interrupt */
565 if (interrupted && dir != NULL && *dir != NULL) { 565 if (interrupted && dir != NULL && *dir != NULL) {
@@ -582,11 +582,11 @@ void free_sftp_dirents(SFTP_DIRENT **s)
582 int i; 582 int i;
583 583
584 for (i = 0; s[i]; i++) { 584 for (i = 0; s[i]; i++) {
585 xfree(s[i]->filename); 585 free(s[i]->filename);
586 xfree(s[i]->longname); 586 free(s[i]->longname);
587 xfree(s[i]); 587 free(s[i]);
588 } 588 }
589 xfree(s); 589 free(s);
590} 590}
591 591
592int 592int
@@ -760,7 +760,7 @@ do_realpath(struct sftp_conn *conn, char *path)
760 debug3("SSH_FXP_REALPATH %s -> %s size %lu", path, filename, 760 debug3("SSH_FXP_REALPATH %s -> %s size %lu", path, filename,
761 (unsigned long)a->size); 761 (unsigned long)a->size);
762 762
763 xfree(longname); 763 free(longname);
764 764
765 buffer_free(&msg); 765 buffer_free(&msg);
766 766
@@ -907,7 +907,7 @@ do_readlink(struct sftp_conn *conn, char *path)
907 907
908 debug3("SSH_FXP_READLINK %s -> %s", path, filename); 908 debug3("SSH_FXP_READLINK %s -> %s", path, filename);
909 909
910 xfree(longname); 910 free(longname);
911 911
912 buffer_free(&msg); 912 buffer_free(&msg);
913 913
@@ -1057,7 +1057,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
1057 local_path, strerror(errno)); 1057 local_path, strerror(errno));
1058 do_close(conn, handle, handle_len); 1058 do_close(conn, handle, handle_len);
1059 buffer_free(&msg); 1059 buffer_free(&msg);
1060 xfree(handle); 1060 free(handle);
1061 return(-1); 1061 return(-1);
1062 } 1062 }
1063 1063
@@ -1121,7 +1121,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
1121 read_error = 1; 1121 read_error = 1;
1122 max_req = 0; 1122 max_req = 0;
1123 TAILQ_REMOVE(&requests, req, tq); 1123 TAILQ_REMOVE(&requests, req, tq);
1124 xfree(req); 1124 free(req);
1125 num_req--; 1125 num_req--;
1126 break; 1126 break;
1127 case SSH2_FXP_DATA: 1127 case SSH2_FXP_DATA:
@@ -1140,11 +1140,11 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
1140 max_req = 0; 1140 max_req = 0;
1141 } 1141 }
1142 progress_counter += len; 1142 progress_counter += len;
1143 xfree(data); 1143 free(data);
1144 1144
1145 if (len == req->len) { 1145 if (len == req->len) {
1146 TAILQ_REMOVE(&requests, req, tq); 1146 TAILQ_REMOVE(&requests, req, tq);
1147 xfree(req); 1147 free(req);
1148 num_req--; 1148 num_req--;
1149 } else { 1149 } else {
1150 /* Resend the request for the missing data */ 1150 /* Resend the request for the missing data */
@@ -1220,7 +1220,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
1220 } 1220 }
1221 close(local_fd); 1221 close(local_fd);
1222 buffer_free(&msg); 1222 buffer_free(&msg);
1223 xfree(handle); 1223 free(handle);
1224 1224
1225 return(status); 1225 return(status);
1226} 1226}
@@ -1292,8 +1292,8 @@ download_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1292 } else 1292 } else
1293 logit("%s: not a regular file\n", new_src); 1293 logit("%s: not a regular file\n", new_src);
1294 1294
1295 xfree(new_dst); 1295 free(new_dst);
1296 xfree(new_src); 1296 free(new_src);
1297 } 1297 }
1298 1298
1299 if (pflag) { 1299 if (pflag) {
@@ -1329,7 +1329,7 @@ download_dir(struct sftp_conn *conn, char *src, char *dst,
1329 1329
1330 ret = download_dir_internal(conn, src_canon, dst, 1330 ret = download_dir_internal(conn, src_canon, dst,
1331 dirattrib, pflag, printflag, 0); 1331 dirattrib, pflag, printflag, 0);
1332 xfree(src_canon); 1332 free(src_canon);
1333 return ret; 1333 return ret;
1334} 1334}
1335 1335
@@ -1481,7 +1481,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1481 debug3("In write loop, ack for %u %u bytes at %lld", 1481 debug3("In write loop, ack for %u %u bytes at %lld",
1482 ack->id, ack->len, (long long)ack->offset); 1482 ack->id, ack->len, (long long)ack->offset);
1483 ++ackid; 1483 ++ackid;
1484 xfree(ack); 1484 free(ack);
1485 } 1485 }
1486 offset += len; 1486 offset += len;
1487 if (offset < 0) 1487 if (offset < 0)
@@ -1491,7 +1491,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1491 1491
1492 if (showprogress) 1492 if (showprogress)
1493 stop_progress_meter(); 1493 stop_progress_meter();
1494 xfree(data); 1494 free(data);
1495 1495
1496 if (status != SSH2_FX_OK) { 1496 if (status != SSH2_FX_OK) {
1497 error("Couldn't write to remote file \"%s\": %s", 1497 error("Couldn't write to remote file \"%s\": %s",
@@ -1511,7 +1511,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
1511 1511
1512 if (do_close(conn, handle, handle_len) != SSH2_FX_OK) 1512 if (do_close(conn, handle, handle_len) != SSH2_FX_OK)
1513 status = -1; 1513 status = -1;
1514 xfree(handle); 1514 free(handle);
1515 1515
1516 return status; 1516 return status;
1517} 1517}
@@ -1597,8 +1597,8 @@ upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
1597 } 1597 }
1598 } else 1598 } else
1599 logit("%s: not a regular file\n", filename); 1599 logit("%s: not a regular file\n", filename);
1600 xfree(new_dst); 1600 free(new_dst);
1601 xfree(new_src); 1601 free(new_src);
1602 } 1602 }
1603 1603
1604 do_setstat(conn, dst, &a); 1604 do_setstat(conn, dst, &a);
@@ -1620,7 +1620,7 @@ upload_dir(struct sftp_conn *conn, char *src, char *dst, int printflag,
1620 } 1620 }
1621 1621
1622 ret = upload_dir_internal(conn, src, dst_canon, pflag, printflag, 0); 1622 ret = upload_dir_internal(conn, src, dst_canon, pflag, printflag, 0);
1623 xfree(dst_canon); 1623 free(dst_canon);
1624 return ret; 1624 return ret;
1625} 1625}
1626 1626