Commit 2d9426b
read-cache: free cache entry in add_to_index in case of early return
This frees `ce` would be leaking in the error path.
Additionally a free is moved towards the return. This helps code
readability as we often have this pattern of freeing resources just
before return/exit and not in between the code.
Signed-off-by: Stefan Beller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent fd2014d commit 2d9426b
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
685 | 684 | | |
686 | 685 | | |
687 | 686 | | |
| 687 | + | |
| 688 | + | |
688 | 689 | | |
689 | 690 | | |
690 | 691 | | |
691 | | - | |
| 692 | + | |
| 693 | + | |
692 | 694 | | |
| 695 | + | |
693 | 696 | | |
694 | 697 | | |
695 | 698 | | |
| |||
0 commit comments