Commit 92be7908bd0fa344dc086d43685225ebd082eae2

Carlos Martín Nieto 2011-10-01T14:46:30

indexer: return immediately if passed a NULL value Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/indexer.c b/src/indexer.c
index 0780335..23fe334 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -385,6 +385,9 @@ void git_indexer_free(git_indexer *idx)
 	struct entry *e;
 	struct git_pack_entry *pe;
 
+	if (idx == NULL)
+		return;
+
 	p_close(idx->pack->mwf.fd);
 	git_vector_foreach(&idx->objects, i, e)
 		free(e);