Commit 32b7e84ec09170761bf9422cc4139be0b14975a9

Brodie Rao 2014-01-12T23:31:35

oid: handle NULL pointers passed to git_oid_shorten_free() Signed-off-by: Brodie Rao <brodie@sf.io>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
 }