summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-08-03 16:50:27 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-08-03 19:44:51 -0400
commitef4857c2b3d4a61fd1d840199afc92eaf2e15345 (patch)
tree2e02b7fcc28a00c0eede602b8880b83a9fd35c77 /src/iterator.c
parent854b701c8a799a484ef48d8b595601ab29876b57 (diff)
downloadlibgit2-ef4857c2b3d4a61fd1d840199afc92eaf2e15345.tar.gz
errors: tighten up git_error_state OOMs a bit more
When an error state is an OOM, make sure that we treat is specially and do not try to free it.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/iterator.c b/src/iterator.c
index cf51a340d..900ffdcaa 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1120,7 +1120,7 @@ static int fs_iterator__expand_dir(fs_iterator *fi)
if (error < 0) {
git_error_state last_error = { 0 };
- giterr_capture(&last_error, error);
+ giterr_state_capture(&last_error, error);
/* these callbacks may clear the error message */
fs_iterator__free_frame(ff);
@@ -1128,7 +1128,7 @@ static int fs_iterator__expand_dir(fs_iterator *fi)
/* next time return value we skipped to */
fi->base.flags &= ~GIT_ITERATOR_FIRST_ACCESS;
- return giterr_restore(&last_error);
+ return giterr_state_restore(&last_error);
}
if (ff->entries.length == 0) {