commit 6b7476e9f2c7f6070401b1d58a55e87149f8151d from: Stefan Sperling date: Sun Mar 11 10:57:28 2018 UTC plug file descriptor leak in worktree test code commit - 45d8e5fd73c78e74a93ad22fe7161f3478f8320a commit + 6b7476e9f2c7f6070401b1d58a55e87149f8151d blob - 1259b0cd6d3ca9eb4574032f91c137a2b4c2cf97 blob + 030daff11cfa0bf0a47b46776049caf3b8ff3423 --- regress/worktree/worktree_test.c +++ regress/worktree/worktree_test.c @@ -170,6 +170,7 @@ obstruct_meta_file(char **path, const char *worktree_p { FILE *f; char *s = "This file should not be here\n"; + int ret = 1; if (asprintf(path, "%s/%s/%s", worktree_path, GOT_WORKTREE_GOT_DIR, name) == -1) @@ -181,10 +182,10 @@ obstruct_meta_file(char **path, const char *worktree_p } if (fwrite(s, 1, strlen(s), f) != strlen(s)) { free(*path); - return 0; + ret = 0; } fclose(f); - return 1; + return ret; } static int