diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-05-13 19:09:25 +0200 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-05-13 19:09:57 +0200 |
commit | 87fe3507bb3e254e7de7298f8b4f1479b1224475 (patch) | |
tree | d7ecdd7e33612b67ab621f85a51710c99d45aee0 /src/iterator.h | |
parent | b72969e0643cb561b42aceec4d1a18ce9c782c09 (diff) | |
download | libgit2-87fe3507bb3e254e7de7298f8b4f1479b1224475.tar.gz |
iterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator
Diffstat (limited to 'src/iterator.h')
-rw-r--r-- | src/iterator.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/iterator.h b/src/iterator.h index 12eb96bb0..974c2daeb 100644 --- a/src/iterator.h +++ b/src/iterator.h @@ -71,6 +71,9 @@ GIT_INLINE(int) git_iterator_reset(git_iterator *iter) GIT_INLINE(void) git_iterator_free(git_iterator *iter) { + if (iter == NULL) + return; + iter->free(iter); git__free(iter); } |