test: Fix leak in regions-mock-trans
This commit is contained in:
parent
df77eb433b
commit
b9c4dbeb33
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user