On Sun, Apr 7, 2013 at 11:29 AM, John Keeping <j...@keeping.me.uk> wrote: > static int is_git_dir(const char *path) > { > struct stat st; > - static char buf[MAX_PATH]; > + struct strbuf pathbuf = STRBUF_INIT; > > - if (snprintf(buf, MAX_PATH, "%s/objects", path) >= MAX_PATH) { > - fprintf(stderr, "Insanely long path: %s\n", path); > - return 0; > - } > - if (stat(buf, &st)) { > + strbuf_addf(&pathbuf, "%s/objects", path); > + if (stat(pathbuf.buf, &st)) { > if (errno != ENOENT) > fprintf(stderr, "Error checking path %s: %s (%d)\n", > path, strerror(errno), errno);
strbuf_release is never called. Does this leak? Are there other cases of this elsewhere? _______________________________________________ cgit mailing list cgit@hjemli.net http://hjemli.net/mailman/listinfo/cgit