Skip to content

Commit d56b407

Browse files
authored
Merge pull request libgit2#6024 from lhchavez/fix-possible-null-pointer-dereference
Fix a possible null pointer dereference
2 parents c811fc3 + 1e49f12 commit d56b407

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/commit_graph.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,8 @@ int git_commit_graph_writer_add_index_file(
716716
goto cleanup;
717717

718718
cleanup:
719-
git_mwindow_put_pack(p);
719+
if (p)
720+
git_mwindow_put_pack(p);
720721
git_odb_free(state.db);
721722
return error;
722723
}

0 commit comments

Comments
 (0)