summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-08-31 09:21:22 -0400
committerGitHub <noreply@github.com>2021-08-31 09:21:22 -0400
commitd56b4079e0474b2f96abe0487a44359970e43c2a (patch)
treefc09c9049477ebfb9efba5866088c7a5174f6798
parentc811fc361be92226eec463f92e33d838fa0e9d54 (diff)
parent1e49f12793c4d39fffb64a08db0d1fddafaf0338 (diff)
downloadlibgit2-d56b4079e0474b2f96abe0487a44359970e43c2a.tar.gz
Merge pull request #6024 from lhchavez/fix-possible-null-pointer-dereference
Fix a possible null pointer dereference
-rw-r--r--src/commit_graph.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commit_graph.c b/src/commit_graph.c
index 9abe373da..71e415e99 100644
--- a/src/commit_graph.c
+++ b/src/commit_graph.c
@@ -716,7 +716,8 @@ int git_commit_graph_writer_add_index_file(
goto cleanup;
cleanup:
- git_mwindow_put_pack(p);
+ if (p)
+ git_mwindow_put_pack(p);
git_odb_free(state.db);
return error;
}