Commit c4f75cc
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 a1dd3ed commit c4f75cc
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1327 | 1327 | | |
1328 | 1328 | | |
1329 | 1329 | | |
1330 | | - | |
| 1330 | + | |
| 1331 | + | |
1331 | 1332 | | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | 1335 | | |
1335 | 1336 | | |
1336 | | - | |
| 1337 | + | |
| 1338 | + | |
1337 | 1339 | | |
1338 | 1340 | | |
1339 | 1341 | | |
| |||
1433 | 1435 | | |
1434 | 1436 | | |
1435 | 1437 | | |
1436 | | - | |
| 1438 | + | |
| 1439 | + | |
1437 | 1440 | | |
1438 | 1441 | | |
1439 | | - | |
1440 | | - | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1441 | 1446 | | |
1442 | 1447 | | |
1443 | 1448 | | |
1444 | 1449 | | |
1445 | 1450 | | |
1446 | 1451 | | |
1447 | | - | |
| 1452 | + | |
| 1453 | + | |
1448 | 1454 | | |
1449 | 1455 | | |
1450 | 1456 | | |
| |||
0 commit comments