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/odb_loose.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/odb_loose.c')
-rw-r--r-- | src/odb_loose.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c index 57a0b0a8e..f1789e071 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -769,7 +769,7 @@ static int loose_backend__write(git_oid *oid, git_odb_backend *_backend, const v { int error, header_len; char final_path[GIT_PATH_MAX], header[64]; - git_filebuf fbuf; + git_filebuf fbuf = GIT_FILEBUF_INIT; loose_backend *backend; backend = (loose_backend *)_backend; |