X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=dir.c;h=3e345c2fc508eb82e66f4ffe2c825670f0bddd99;hb=23a485e3ee32a9445e1c20bd4fd4b93119cd4f7c;hp=d448902909a7da216fbd49cecc505e68c0ba5e5f;hpb=cd390763d487c140570ced10ac0d955908072fc6;p=git.git diff --git a/dir.c b/dir.c index d44890290..3e345c2fc 100644 --- a/dir.c +++ b/dir.c @@ -169,7 +169,10 @@ static int add_excludes_from_file_1(const char *fname, } 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; } /*