Sema: Fix memory leak

This commit is contained in:
Luuk de Gram 2022-02-06 12:30:30 +01:00 committed by Andrew Kelley
parent fd1284ebd0
commit 545aa790a4

View File

@ -7058,6 +7058,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
sema.air_extra.appendSliceAssumeCapacity(prev_then_body);
sema.air_extra.appendSliceAssumeCapacity(cond_body);
}
gpa.free(prev_then_body);
prev_then_body = case_block.instructions.toOwnedSlice(gpa);
prev_cond_br = new_cond_br;
}