test: Fix leak in regions-mock-trans

This commit is contained in:
Patrick Walton 2012-03-23 15:17:34 -07:00
parent df77eb433b
commit b9c4dbeb33

View File

@ -15,7 +15,7 @@ type ccx = {
x: int
};
fn alloc(bcx : &a.arena) -> &a.bcx unsafe {
fn alloc(_bcx : &a.arena) -> &a.bcx unsafe {
ret unsafe::reinterpret_cast(libc::malloc(sys::size_of::<bcx>()));
}
@ -26,6 +26,9 @@ fn h(bcx : &a.bcx) -> &a.bcx {
fn g(fcx : &fcx) {
let bcx = { fcx: fcx };
let bcx2 = h(&bcx);
unsafe {
libc::free(unsafe::reinterpret_cast(bcx2));
}
}
fn f(ccx : &ccx) {