]> andersk Git - openssh.git/blobdiff - sftp-glob.c
- espie@cvs.openbsd.org 2002/08/21 11:20:59
[openssh.git] / sftp-glob.c
index 1234074c45ccc0d3f076cb0f5452517a2eef8d63..2a7cf141cc20bc6db1c3064978d0079d7fde4232 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-glob.c,v 1.10 2002/02/13 00:59:23 djm Exp $");
+RCSID("$OpenBSD: sftp-glob.c,v 1.12 2002/07/04 04:15:33 deraadt Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -51,12 +51,14 @@ 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;
 
-       return((void*)r);
+       return((void *)r);
 }
 
 static struct dirent *
@@ -129,7 +131,7 @@ fudge_lstat(const char *path, struct stat *st)
 {
        Attrib *a;
 
-       if (!(a = do_lstat(cur.conn, (char*)path, 0)))
+       if (!(a = do_lstat(cur.conn, (char *)path, 0)))
                return(-1);
 
        attrib_to_stat(a, st);
@@ -142,7 +144,7 @@ fudge_stat(const char *path, struct stat *st)
 {
        Attrib *a;
 
-       if (!(a = do_stat(cur.conn, (char*)path, 0)))
+       if (!(a = do_stat(cur.conn, (char *)path, 0)))
                return(-1);
 
        attrib_to_stat(a, st);
This page took 0.039075 seconds and 4 git commands to generate.