Fix bad release memory