Skip to content

Commit e40c2a8

Browse files
pks-tgitster
authored andcommitted
global: drop UNLEAK() annotation
There are two users of `UNLEAK()` left in our codebase: - In "builtin/clone.c", annotating the `repo` variable. That leak has already been fixed though as you can see in the context, where we do know to free `repo_to_free`. - In "builtin/diff.c", to unleak entries of the `blob[]` array. That leak has also been fixed, because the entries we assign to that array come from `rev.pending.objects`, and we do eventually release `rev`. This neatly demonstrates one of the issues with `UNLEAK()`: it is quite easy for the annotation to become stale. A second issue is that its whole intent is to paper over leaks. And while that has been a necessary evil in the past, because Git was leaking left and right, it isn't really much of an issue nowadays where our test suite has no known leaks anymore. Remove the last two users of this macro. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8ab8279 commit e40c2a8

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

builtin/clone.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,6 @@ int cmd_clone(int argc,
15861586
free(dir);
15871587
free(path);
15881588
free(repo_to_free);
1589-
UNLEAK(repo);
15901589
junk_mode = JUNK_LEAVE_ALL;
15911590

15921591
transport_ls_refs_options_release(&transport_ls_refs_options);

builtin/diff.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,5 @@ int cmd_diff(int argc,
628628
release_revisions(&rev);
629629
object_array_clear(&ent);
630630
symdiff_release(&sdiff);
631-
UNLEAK(blob);
632631
return result;
633632
}

0 commit comments

Comments
 (0)