*/
#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"
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 *
{
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);
{
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);