summaryrefslogtreecommitdiff
path: root/src/errors.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-08-24 12:19:22 -0700
committerRussell Belfer <rb@github.com>2012-08-24 12:19:22 -0700
commit97a17e4e9fa5cafa531ff79cb88a9ee5c224a613 (patch)
treec45a8400538c843c74095ea30fd22e50caa1c502 /src/errors.c
parent5f4a61aea834fe25ce1596bc9c0e0b5e563aa98b (diff)
downloadlibgit2-97a17e4e9fa5cafa531ff79cb88a9ee5c224a613.tar.gz
Fix valgrind warnings and spurious error messages
Just clean up valgrind warnings about uninitialized memory and also clear out errno in some cases where it results in a false error message being generated at a later point.
Diffstat (limited to 'src/errors.c')
-rw-r--r--src/errors.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/errors.c b/src/errors.c
index d43d7d9b5..802ad3647 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -110,6 +110,11 @@ void giterr_set_regex(const regex_t *regex, int error_code)
void giterr_clear(void)
{
GIT_GLOBAL->last_error = NULL;
+
+ errno = 0;
+#ifdef GIT_WIN32
+ SetLastError(0);
+#endif
}
const git_error *giterr_last(void)