Commit d2aa6de7224552f648887950fec8c2f55629526d

nulltoken 2012-10-03T13:56:13

reflog: Make git_reflog_free() accept null param

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/reflog.c b/src/reflog.c
index a1ea7a2..3c780cd 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -166,6 +166,9 @@ void git_reflog_free(git_reflog *reflog)
 	unsigned int i;
 	git_reflog_entry *entry;
 
+	if (reflog == NULL)
+		return;
+
 	for (i=0; i < reflog->entries.length; i++) {
 		entry = git_vector_get(&reflog->entries, i);