diff options
author | Russell Belfer <rb@github.com> | 2013-03-14 13:50:54 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-03-14 13:50:54 -0700 |
commit | d85296ab9b9c4a01adb35d4d2438b72177aeabc4 (patch) | |
tree | 93f0fb0d155fd9ed571e3a5ab6a67ca37ba84607 /src/errors.c | |
parent | 0c46863384e9da3746b90ddf81eef6d25d475e5c (diff) | |
download | libgit2-d85296ab9b9c4a01adb35d4d2438b72177aeabc4.tar.gz |
Fix valgrind issues (and mmap fallback for diff)
This fixes a number of issues identified by valgrind - mostly
missed free calls. Inside valgrind, mmap() may fail which causes
some of the diff tests to fail. This adds a fallback code path
to diff_output.c:get_workdir_content() where is the mmap() fails
the code will now try to read the file data directly into allocated
memory (which is what it would do if the data needed to be filtered
anyhow).
Diffstat (limited to 'src/errors.c')
-rw-r--r-- | src/errors.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/errors.c b/src/errors.c index c5f0b3b59..e2629f69e 100644 --- a/src/errors.c +++ b/src/errors.c @@ -103,6 +103,7 @@ int giterr_set_regex(const regex_t *regex, int error_code) void giterr_clear(void) { + set_error(0, NULL); GIT_GLOBAL->last_error = NULL; errno = 0; |