oid: handle NULL pointers passed to git_oid_shorten_free() Signed-off-by: Brodie Rao <brodie@sf.io>
diff --git a/src/oid.c b/src/oid.c
index d56b6af..567b6cf 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -314,6 +314,9 @@ git_oid_shorten *git_oid_shorten_new(size_t min_length)
void git_oid_shorten_free(git_oid_shorten *os)
{
+ if (os == NULL)
+ return;
+
git__free(os->nodes);
git__free(os);
}