summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}