Commit edca6c8fed0a95c1308cbef1edb5a0ace25889b7

Michael Schubert 2012-07-01T19:44:22

git_odb_object_free: don't segfault w/ arg == NULL

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/odb.c b/src/odb.c
index d951bc5..7c21598 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -107,6 +107,9 @@ git_otype git_odb_object_type(git_odb_object *object)
 
 void git_odb_object_free(git_odb_object *object)
 {
+	if (object == NULL)
+		return;
+
 	git_cached_obj_decref((git_cached_obj *)object, &free_odb_object);
 }