Thread (45 messages) 45 messages, 2 authors, 2023-06-17

Re: [PATCH 06/11] branch: fix a leak in cmd_branch

From: Rubén Justo <hidden>
Date: 2023-06-16 22:50:54

On 11-jun-2023 23:46:39, Jeff King wrote:
On Sun, Jun 11, 2023 at 08:50:05PM +0200, Rubén Justo wrote:
quoted
We don't have a common clean-up section in cmd_branch().  To avoid
refactoring and keep the fix simple, and while we find a better
solution, let's silence the leak-hunter making the list static.
Gross. :)
XD
quoted hunk ↗ jump to hunk
If we are just going to annotate here, I'd prefer to use UNLEAK(). It
makes it more obvious this is about leak-checking, and doesn't imply
that we otherwise care about the lifetime of this field. Like:
diff --git a/builtin/branch.c b/builtin/branch.c
index e6c2655af6..075e580d22 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -832,6 +832,8 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 	if (list)
 		setup_auto_pager("branch", 1);
 
+	UNLEAK(sorting_options);
+
 	if (delete) {
 		if (!argc)
 			die(_("branch name required"));
OK.  Will do this.

Thank you for reviewing the change with a wide view.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help