Skip to content

Commit 7873d81

Browse files
committed
Fixed memory leak in emubd's out-of-order write emulation
We need to decrement the saved block state on sync, when we reset out-of-order emulation. Otherwise we leak blocks out the wazoo.
1 parent fc2aa33 commit 7873d81

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bd/lfs_emubd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ int lfs_emubd_sync(const struct lfs_config *cfg) {
531531
// emulate out-of-order writes? reset first write, writes
532532
// cannot be out-of-order across sync
533533
if (bd->cfg->powerloss_behavior == LFS_EMUBD_POWERLOSS_OOO) {
534+
lfs_emubd_decblock(bd->ooo_data);
534535
bd->ooo_block = -1;
535536
bd->ooo_data = NULL;
536537
}

0 commit comments

Comments
 (0)