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

From:
Mark Jamsek <mark@jamsek.com>
Subject:
plug ref leak in got update
To:
gameoftrees@openbsd.org
Date:
Sun, 23 Jul 2023 20:09:57 +1000

Download raw body.

Thread
As per the subject, we leak head_ref in cmd_update()


-----------------------------------------------
commit 02af858a6ee42bbbf72128ab9643d850e32bce51 (main)
from: Mark Jamsek <mark@jamsek.dev>
date: Sun Jul 23 10:02:35 2023 UTC
 
 plug got_referece leak in cmd_update()
 
diff 863cc633e270c0edf587982ac9faccf7bb28f339 02af858a6ee42bbbf72128ab9643d850e32bce51
commit - 863cc633e270c0edf587982ac9faccf7bb28f339
commit + 02af858a6ee42bbbf72128ab9643d850e32bce51
blob - ff960485254894c4b8c41fda56a2319bc2b89b17
blob + dae05a53000410c2bf66f6696b63f8af1312036e
--- got/got.c
+++ got/got.c
@@ -3680,6 +3680,8 @@ done:
 		if (error == NULL)
 			error = close_err;
 	}
+	if (head_ref != NULL)
+		got_ref_close(head_ref);
 	free(worktree_path);
 	got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
 	free(commit_id);


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