Commit 6249107b89fc7695216b8c3269436ff99cf7d213

Stefan Sperling 2019-03-15T13:35:47

fix uninitialized variable in insert_ref()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/reference.c b/lib/reference.c
index e6d36a8..16f6a62 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -551,7 +551,7 @@ insert_ref(struct got_reflist_entry **newp, struct got_reflist_head *refs,
 {
 	const struct got_error *err;
 	struct got_object_id *id;
-	struct got_reflist_entry *new, *re, *prev;
+	struct got_reflist_entry *new, *re, *prev = NULL;
 	int cmp;
 
 	*newp = NULL;