Commit 9c2262d
midx-write: use cleanup when incremental midx fails
The incremental mode of writing a multi-pack-index has a few extra
conditions that could lead to failure, but these are currently
short-ciruiting with 'return -1' instead of setting the method's
'result' variable and going to the cleanup tag.
Replace these returns with gotos to avoid memory issues when exiting
early due to error conditions.
Unfortunately, these error conditions are difficult to reproduce with
test cases, which is perhaps one reason why the memory loss was not
caught by existing test cases in memory tracking modes.
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 3a45c7b commit 9c2262d
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1345 | 1345 | | |
1346 | 1346 | | |
1347 | 1347 | | |
1348 | | - | |
| 1348 | + | |
| 1349 | + | |
1349 | 1350 | | |
1350 | 1351 | | |
1351 | 1352 | | |
1352 | 1353 | | |
1353 | 1354 | | |
1354 | | - | |
| 1355 | + | |
| 1356 | + | |
1355 | 1357 | | |
1356 | 1358 | | |
1357 | 1359 | | |
| |||
1451 | 1453 | | |
1452 | 1454 | | |
1453 | 1455 | | |
1454 | | - | |
| 1456 | + | |
| 1457 | + | |
1455 | 1458 | | |
1456 | 1459 | | |
1457 | | - | |
1458 | | - | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
1459 | 1464 | | |
1460 | 1465 | | |
1461 | 1466 | | |
1462 | 1467 | | |
1463 | 1468 | | |
1464 | 1469 | | |
1465 | | - | |
| 1470 | + | |
| 1471 | + | |
1466 | 1472 | | |
1467 | 1473 | | |
1468 | 1474 | | |
| |||
0 commit comments