diff options
Diffstat (limited to 'usr.bin/ssh/sftp-glob.c')
-rw-r--r-- | usr.bin/ssh/sftp-glob.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/sftp-glob.c b/usr.bin/ssh/sftp-glob.c index 3d718470ce2..b9d4e28961f 100644 --- a/usr.bin/ssh/sftp-glob.c +++ b/usr.bin/ssh/sftp-glob.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sftp-glob.c,v 1.11 2002/06/30 21:59:45 deraadt Exp $"); +RCSID("$OpenBSD: sftp-glob.c,v 1.12 2002/07/04 04:15:33 deraadt Exp $"); #include <glob.h> @@ -53,8 +53,10 @@ fudge_opendir(const char *path) r = xmalloc(sizeof(*r)); - if (do_readdir(cur.conn, (char *)path, &r->dir)) + if (do_readdir(cur.conn, (char *)path, &r->dir)) { + xfree(r); return(NULL); + } r->offset = 0; |