Commit 49b6afa
committed
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>1 parent 721dab7 commit 49b6afa
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1339 | 1339 | | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | | - | |
| 1342 | + | |
| 1343 | + | |
1343 | 1344 | | |
1344 | 1345 | | |
1345 | 1346 | | |
1346 | 1347 | | |
1347 | 1348 | | |
1348 | | - | |
| 1349 | + | |
| 1350 | + | |
1349 | 1351 | | |
1350 | 1352 | | |
1351 | 1353 | | |
| |||
1445 | 1447 | | |
1446 | 1448 | | |
1447 | 1449 | | |
1448 | | - | |
| 1450 | + | |
| 1451 | + | |
1449 | 1452 | | |
1450 | 1453 | | |
1451 | | - | |
1452 | | - | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1453 | 1458 | | |
1454 | 1459 | | |
1455 | 1460 | | |
1456 | 1461 | | |
1457 | 1462 | | |
1458 | 1463 | | |
1459 | | - | |
| 1464 | + | |
| 1465 | + | |
1460 | 1466 | | |
1461 | 1467 | | |
1462 | 1468 | | |
| |||
0 commit comments