Commit 2139bd0
http-backend.c: fix cmd_main() memory leak, refactor reg{exec,free}()
Fix a memory leak that's been with us ever since
2f4038a (Git-aware CGI to provide dumb HTTP transport,
2009-10-30). In this case we're not calling regerror() after a failed
regexec(), and don't otherwise use "re" afterwards.
We can therefore simplify this code by calling regfree() right after
the regexec(). An alternative fix would be to add a regfree() to both
the "return" and "break" path in this for-loop.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent eef75d2 commit 2139bd0
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| 762 | + | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
765 | | - | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
766 | 770 | | |
767 | 771 | | |
768 | 772 | | |
| |||
774 | 778 | | |
775 | 779 | | |
776 | 780 | | |
777 | | - | |
778 | 781 | | |
779 | 782 | | |
780 | 783 | | |
| |||
0 commit comments