"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
zap dead variable in got.c:add_branch()
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Tue, 10 Jan 2023 22:58:56 +1100

Download raw body.

Thread
As per the subject, this looks like a holdover no longer being used.

diff 75b17c2a7d14fc0476cba0375a5a031cf0c13a00 refs/heads/main
commit - 75b17c2a7d14fc0476cba0375a5a031cf0c13a00
commit + 14048173ff560be5e9c163faf15d37e2130ef00a
blob - 7f294d2ed40076ca1dedf56ff7581a9d161936e6
blob + 5e95ca3316302472e74abae334031fd6835220aa
--- got/got.c
+++ got/got.c
@@ -6800,7 +6800,7 @@ add_branch(struct got_repository *repo, const char *br
 {
 	const struct got_error *err = NULL;
 	struct got_reference *ref = NULL;
-	char *base_refname = NULL, *refname = NULL;
+	char *refname = NULL;
 
 	/*
 	 * Don't let the user create a branch name with a leading '-'.
@@ -6833,7 +6833,6 @@ done:
 done:
 	if (ref)
 		got_ref_close(ref);
-	free(base_refname);
 	free(refname);
 	return err;
 }

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68