Commit 76c7e70
diff: fix leaking orderfile option
The `orderfile` diff option is being assigned via `OPT_FILENAME()`,
which assigns an allocated string to the variable. We never free it
though, causing a memory leak.
Change the type of the string to `char *` and free it to plug the leak.
This also requires us to use `xstrdup()` to assign the global config to
it in case it is set.
This leak is being hit in t7621, but plugging it alone does not make the
test suite pass.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 49af1b7 commit 76c7e70
3 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
1396 | | - | |
1397 | 1396 | | |
1398 | | - | |
| 1397 | + | |
1399 | 1398 | | |
1400 | 1399 | | |
1401 | 1400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
| 445 | + | |
445 | 446 | | |
| 447 | + | |
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
| |||
4775 | 4777 | | |
4776 | 4778 | | |
4777 | 4779 | | |
4778 | | - | |
| 4780 | + | |
4779 | 4781 | | |
4780 | 4782 | | |
4781 | 4783 | | |
| |||
6727 | 6729 | | |
6728 | 6730 | | |
6729 | 6731 | | |
| 6732 | + | |
6730 | 6733 | | |
6731 | 6734 | | |
6732 | 6735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
0 commit comments