index d448902909a7da216fbd49cecc505e68c0ba5e5f..3e345c2fc508eb82e66f4ffe2c825670f0bddd99 100644 (file)
--- a/dir.c
+++ b/dir.c
}
buf = xmalloc(size+1);
if (read_in_full(fd, buf, size) != size)
+ {
+ free(buf);
goto err;
+ }
close(fd);
if (buf_p)
@@ -692,7 +695,7 @@ int read_directory(struct dir_struct *dir, const char *path, const char *base, i
int file_exists(const char *f)
{
struct stat sb;
- return stat(f, &sb) == 0;
+ return lstat(f, &sb) == 0;
}
/*