Commit 6fdbf7b0468582179f8092cb136a1ac50cadc428

Stefan Sperling 2019-03-15T13:14:08

better malloc size idiom 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 b892f24..3eb4935 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -560,7 +560,7 @@ insert_ref(struct got_reflist_entry **newp, struct got_reflist_head *refs,
 	if (err)
 		return err;
 
-	new = malloc(sizeof(*re));
+	new = malloc(sizeof(*new));
 	if (new == NULL) {
 		free(id);
 		return got_error_from_errno();