Commit bf91fd5
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 da31820 commit bf91fd5
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
| 1324 | + | |
| 1325 | + | |
1325 | 1326 | | |
1326 | 1327 | | |
1327 | 1328 | | |
1328 | 1329 | | |
1329 | 1330 | | |
1330 | | - | |
| 1331 | + | |
| 1332 | + | |
1331 | 1333 | | |
1332 | 1334 | | |
1333 | 1335 | | |
| |||
1427 | 1429 | | |
1428 | 1430 | | |
1429 | 1431 | | |
1430 | | - | |
| 1432 | + | |
| 1433 | + | |
1431 | 1434 | | |
1432 | 1435 | | |
1433 | | - | |
1434 | | - | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1435 | 1440 | | |
1436 | 1441 | | |
1437 | 1442 | | |
1438 | 1443 | | |
1439 | 1444 | | |
1440 | 1445 | | |
1441 | | - | |
| 1446 | + | |
| 1447 | + | |
1442 | 1448 | | |
1443 | 1449 | | |
1444 | 1450 | | |
| |||
0 commit comments