diff options
author | Russell Belfer <arrbee@arrbee.com> | 2011-11-17 15:10:27 -0800 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-11-22 01:53:56 +0100 |
commit | b762e576c6d0118664320f50be2e5810dbed4c15 (patch) | |
tree | 2c244a57ca5167386856c573336093744464daa6 /src/fetch.c | |
parent | 1d09a1c88ddde32bf9b6b5ab6a9feab2ecdaa6ff (diff) | |
download | libgit2-b762e576c6d0118664320f50be2e5810dbed4c15.tar.gz |
filebuf: add GIT_FILEBUF_INIT and protect multiple opens and cleanups
Update all stack allocations of git_filebuf to use GIT_FILEBUF_INIT
and make git_filebuf_open and git_filebuf_cleanup safe to be called
multiple times on the same buffer.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/fetch.c')
-rw-r--r-- | src/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c index af7dbaffd..a42732925 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -138,7 +138,7 @@ int git_fetch_download_pack(char **out, git_remote *remote) int git_fetch__download_pack(char **out, const char *buffered, size_t buffered_size, GIT_SOCKET fd, git_repository *repo) { - git_filebuf file; + git_filebuf file = GIT_FILEBUF_INIT; int error; char buff[1024], path[GIT_PATH_MAX]; static const char suff[] = "/objects/pack/pack-received"; |