Commit 4c4ce67b628a0b29afb50487072e667ee37e1dad

Stefan Sperling 2020-12-25T21:38:17

fix assignment to wrong pointer in got_ref_dup() ok naddy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/lib/reference.c b/lib/reference.c
index ef042bc..7df07c9 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -535,8 +535,8 @@ got_ref_dup(struct got_reference *ref)
 			return NULL;
 		}
 	} else {
-		ref->ref.ref.name = strdup(ref->ref.ref.name);
-		if (ref->ref.ref.name == NULL) {
+		ret->ref.ref.name = strdup(ref->ref.ref.name);
+		if (ret->ref.ref.name == NULL) {
 			free(ret);
 			return NULL;
 		}