diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-29 20:44:04 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-29 20:44:04 +0000 |
commit | 98519f41a249c1fe03a79fd8cdc0127b25833ba1 (patch) | |
tree | b77218cc1da1a81dfc4fa67a292094f5b431df78 /usr.bin | |
parent | 2e2c63154c2d1d05a8dea16c9e55504f9b2e2276 (diff) |
clear the malloc'd buffer, otherwise source() will leak malloc'd memory; ok theo@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/scp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 3f120b04679..fb95155c372 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.80 2001/08/13 23:38:54 stevesk Exp $"); +RCSID("$OpenBSD: scp.c,v 1.81 2001/08/29 20:44:03 markus Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -1010,6 +1010,7 @@ allocbuf(bp, fd, blksize) bp->buf = xmalloc(size); else bp->buf = xrealloc(bp->buf, size); + memset(bp->buf, 0, size); bp->cnt = size; return (bp); } |