Commit 4a37b80
xdiff: refactor a function
Use the standard "goto out" pattern rather than repeating very similar
code after checking for each error. This will simplify the next commit
that starts handling allocation failures that are currently ignored.
On error xdl_do_diff() frees the environment so we need to take care
to avoid a double free in that case. xdl_build_script() does not
assign a result unless it is successful so there is no possibility of
a double free if it fails.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 61f8839 commit 4a37b80
1 file changed
+16
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
| 687 | + | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
696 | 696 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
702 | 701 | | |
703 | 702 | | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
708 | 706 | | |
709 | 707 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
716 | 711 | | |
717 | 712 | | |
718 | 713 | | |
| |||
727 | 722 | | |
728 | 723 | | |
729 | 724 | | |
| 725 | + | |
730 | 726 | | |
731 | 727 | | |
732 | 728 | | |
733 | | - | |
734 | 729 | | |
| 730 | + | |
| 731 | + | |
735 | 732 | | |
736 | 733 | | |
737 | 734 | | |
0 commit comments