diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-03-21 08:10:40 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-03-21 08:12:25 +0100 |
commit | e285bdc93b6d53e7e46aedaea00f95d7b961b78d (patch) | |
tree | c584256d09c52c7330f89d73254c7f41a8dffece | |
parent | 0d0fa7c3681e4ef3d0452666a9bc97d4b08391c9 (diff) | |
download | libgit2-e285bdc93b6d53e7e46aedaea00f95d7b961b78d.tar.gz |
test_helpers: fix unepextected closing of file on error
-rw-r--r-- | tests/test_helpers.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_helpers.c b/tests/test_helpers.c index 9ed0d79d8..fc0351977 100644 --- a/tests/test_helpers.c +++ b/tests/test_helpers.c @@ -197,7 +197,8 @@ int copy_file(const char *src, const char *dst) cleanup: git_buf_free(&source_buf); - p_close(dst_fd); + if (dst_fd >= 0) + p_close(dst_fd); return error; } |