Re: [PATCH] commit-graph: avoid memory leaks
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 4, 2020, 20:20 UTC
- Message-ID
- <16be6de4-3453-2fc2-2881-7068bf674517@gmail.com>
- In-Reply-To
- <20200504191324.201663-1-jonathantanmy@google.com>
On 5/4/2020 3:13 PM, Jonathan Tan wrote:
Show 5 quoted lines
> A fuzzer running on the entry point provided by fuzz-commit-graph.c > revealed a memory leak when parse_commit_graph() creates a struct > bloom_filter_settings and then returns early due to error. Fix that > error by always freeing that struct first (if it exists) before > returning early due to error.
This fuzzer is an excellent tool that I hope can continue to be extended to other features. Here is a case where it found an error in a feature long after the integration was introduced.
> While making that change, I also noticed another possible memory leak - > when the BLOOMDATA chunk is provided but not BLOOMINDEXES. Also fix that > error.
Thanks for discovering these issues, and for fixing them!
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Thanks, -Stolee