debug: double free, set as NULL the pointer after freed