diff options
author | lhchavez <lhchavez@lhchavez.com> | 2017-12-06 03:22:58 +0000 |
---|---|---|
committer | lhchavez <lhchavez@lhchavez.com> | 2017-12-06 04:32:16 +0000 |
commit | 400caed3e0f93093d98619524184bf44937470c8 (patch) | |
tree | 43fc077c0c068a358058f34636f461a555f3e0d4 /src/indexer.c | |
parent | 429bb3575474a3d25ee1c9814612d8d01b3378e8 (diff) | |
download | libgit2-400caed3e0f93093d98619524184bf44937470c8.tar.gz |
libFuzzer: Fix a git_packfile_stream leak
This change ensures that the git_packfile_stream object in
git_indexer_append() does not leak when the stream has errors.
Found using libFuzzer.
Diffstat (limited to 'src/indexer.c')
-rw-r--r-- | src/indexer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/indexer.c b/src/indexer.c index 766bbc3c3..aedefe523 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -1119,6 +1119,9 @@ void git_indexer_free(git_indexer *idx) if (idx == NULL) return; + if (idx->have_stream) + git_packfile_stream_free(&idx->stream); + git_vector_free_deep(&idx->objects); if (idx->pack->idx_cache) { |